dotfiles/.vscode/extensions/saviorisdead.RustyCode-0.18.0/node_modules/flagged-respawn/index.js
Cyryl Płotnicki 2f946d6200 Add .vscode
2016-09-11 10:29:13 +02:00

18 lines
501 B
JavaScript

const reorder = require('./lib/reorder');
const respawn = require('./lib/respawn');
module.exports = function (flags, argv, execute) {
if (!flags) {
throw new Error('You must specify flags to respawn with.');
}
if (!argv) {
throw new Error('You must specify an argv array.');
}
var proc = process;
var reordered = reorder(flags, argv);
var ready = JSON.stringify(argv) === JSON.stringify(reordered);
if (!ready) {
proc = respawn(reordered);
}
execute(ready, proc);
};