Skip to content

Commit

Permalink
Fix spawning of Node.js binaries (.cmd files) on Windows (#6)
Browse files Browse the repository at this point in the history
* Fix spawning of .bat/.cmd files on Windows

* Code style fixes
  • Loading branch information
raleksandar authored and arjunmehta committed Apr 2, 2017
1 parent 79a2238 commit b906ba0
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion lib/Spawn.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,17 @@ var spawn = require('child_process').spawn;
function Spawn(stream, command, args, name, output) {
var exited = false;
var ended = false;
var spawnedProcess = spawn(command, args);
var spawnedProcess;
var options;

if (process.platform === 'win32') {
options = {
// required so that .bat/.cmd files can be spawned
shell: process.env.comspec || 'cmd.exe'
};
}

spawnedProcess = spawn(command, args, options);

this.id = name;

Expand Down

0 comments on commit b906ba0

Please sign in to comment.