Skip to content

Commit

Permalink
Fix build on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
addaleax committed Apr 3, 2016
1 parent 8da4196 commit b0971c4
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,19 @@ function wrap (argv, env, workingDir) {
)) {
cmdi = options.args.indexOf('/c')
if (cmdi !== -1) {
options.args[cmdi + 1] = winRebase(options.args[cmdi + 1], workingDir + '/node.cmd')
var c = options.args[cmdi + 1];
var npmre = /^npm\b/;

if (npmre.test(c)) {
var npmPath = whichOrUndefined('npm')

if (npmPath) {
c = c.replace(npmre, 'node ' + npmPath)
}
}

c = winRebase(c, workingDir + '/node.cmd')
options.args[cmdi + 1] = c
}
} else if (file === 'node' || file === 'iojs' || cmdname === file) {
// make sure it has a main script.
Expand Down

0 comments on commit b0971c4

Please sign in to comment.