Merge pull request #95 from LorenzGardner/master

Make process.argv consistent in the child fork case
This commit is contained in:
Jared Allard
2015-02-09 17:46:51 -08:00
+2 -2
View File
@@ -112,12 +112,12 @@ var loader = function (deps, key) {
if (process.argv[2] == "--child_process" && deps[argv3]) {
//we've been forked and should run the module specified by argv3[3] instead of the start up module
key = argv3;
process.argv = process.argv.splice(2, 2);
process.argv.splice(2, 2); //restore the argv to [0] = executable, [1] = nexejs
}
else if (process.argv[2] == "--child_process") {
//fork called, but for a module not bundled.
argv3 = process.argv[3];
process.argv = process.argv.splice(2, 2);
process.argv.splice(1, 2); //restore the argv to [0] = executable, [1] = script
global.require(argv3);
return;
}