From dcf44f7a801a740884e74b519bc3dc7b13c2ae65 Mon Sep 17 00:00:00 2001 From: Lorenz Gardner Date: Mon, 9 Feb 2015 16:05:09 -0600 Subject: [PATCH] Make process.argv consistent in the child fork cas (argv.[0] must = the executable) --- lib/bundle.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/bundle.js b/lib/bundle.js index 64f3a3b..c9dea18 100644 --- a/lib/bundle.js +++ b/lib/bundle.js @@ -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; }