Skip to content

Commit

Permalink
fixed a problem with starting a child process on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
beatfactor committed Jun 5, 2014
1 parent 2a6b743 commit 5b7b0df
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions bin/_clirunner.js
Original file line number Diff line number Diff line change
Expand Up @@ -411,8 +411,8 @@ CliRunner.prototype = {
* based on the args passed to the main process
* @returns {Array}
*/
getChildProcessArgs : function() {
var args = [];
getChildProcessArgs : function(mainModule) {
var args = [mainModule];
for (var i = 2; i < process.argv.length; i++) {
if (process.argv[i] == '-e' || process.argv[i] == '--env') {
i++;
Expand Down Expand Up @@ -481,14 +481,14 @@ CliRunner.prototype = {
};

envs.forEach(function(item, index) {
var cliArgs = self.getChildProcessArgs();
var cliArgs = self.getChildProcessArgs(mainModule);
cliArgs.push('-e', item, '__parallel-mode');
var env = process.env;
setTimeout(function() {
env.__NIGHTWATCH_PARALLEL_MODE = 1;
env.__NIGHTWATCH_ENV = item;

child = execFile(mainModule, cliArgs, {
child = execFile(process.execPath, cliArgs, {
cwd : process.cwd(),
encoding: 'utf8',
env : env
Expand Down

0 comments on commit 5b7b0df

Please sign in to comment.