motion
Version:
motion - moving development forward
34 lines (24 loc) • 604 B
JavaScript
exports.__esModule = true;
exports.now = now;
exports.setChild = setChild;
var _libFns = require('./lib/fns');
// STOP
process.on('SIGINT', cleanExit);
process.on('SIGTERM', cleanExit);
process.on('uncaughtException', cleanExit);
var child = undefined;
function cleanExit(e) {
if (e) _libFns.logError(e);
child && child.send('EXIT'); // this seems to be required
setTimeout(function () {
child && child.kill('SIGINT');
process.exit(0);
});
}
function now() {
cleanExit();
}
function setChild(_child) {
child = _child;
}
exports['default'] = { now: now, setChild: setChild };