mirror of
https://github.com/morhetz/gruvbox.git
synced 2025-11-17 07:43:38 -05:00
chore(package): re-init package with commitizen and standard-release
This commit is contained in:
30
node_modules/exit-hook/index.js
generated
vendored
Normal file
30
node_modules/exit-hook/index.js
generated
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
'use strict';
|
||||
|
||||
var cbs = [];
|
||||
var called = false;
|
||||
|
||||
function exit(exit, signal) {
|
||||
if (called) {
|
||||
return;
|
||||
}
|
||||
|
||||
called = true;
|
||||
|
||||
cbs.forEach(function (el) {
|
||||
el();
|
||||
});
|
||||
|
||||
if (exit === true) {
|
||||
process.exit(128 + signal);
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = function (cb) {
|
||||
cbs.push(cb);
|
||||
|
||||
if (cbs.length === 1) {
|
||||
process.once('exit', exit);
|
||||
process.once('SIGINT', exit.bind(null, true, 2));
|
||||
process.once('SIGTERM', exit.bind(null, true, 15));
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user