Make process.argv consistent in the child fork cas

(argv.[0] must = the executable)
This commit is contained in:
Lorenz Gardner
2015-02-09 16:05:09 -06:00
parent c34f6719b5
commit 29d5f6aaeb
+2 -2
View File
@@ -113,12 +113,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;
}