Make process.argv consistent in the child fork cas
(argv.[0] must = the executable)
This commit is contained in:
+2
-2
@@ -113,12 +113,12 @@ var loader = function (deps, key) {
|
|||||||
if (process.argv[2] == "--child_process" && deps[argv3]) {
|
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
|
//we've been forked and should run the module specified by argv3[3] instead of the start up module
|
||||||
key = argv3;
|
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") {
|
else if (process.argv[2] == "--child_process") {
|
||||||
//fork called, but for a module not bundled.
|
//fork called, but for a module not bundled.
|
||||||
argv3 = process.argv[3];
|
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);
|
global.require(argv3);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user