Skip to content

Commit

Permalink
fix(win32): handle cases where "node" is quoted (#102)
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacs authored and bcoe committed Aug 23, 2019
1 parent 7931ab5 commit aac8730
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion index.js
Expand Up @@ -417,8 +417,13 @@ function setup (argv, env) {
var cmdShim =
'@echo off\r\n' +
'SETLOCAL\r\n' +
'CALL :find_dp0\r\n' +
'SET PATHEXT=%PATHEXT:;.JS;=;%\r\n' +
'"' + process.execPath + '"' + ' "%~dp0\\.\\node" %*\r\n'
'"' + process.execPath + '"' + ' "%dp0%node" %*\r\n' +
'EXIT /b %errorlevel%\r\n'+
':find_dp0\r\n' +
'SET dp0=%~dp0\r\n' +
'EXIT /b\r\n'

fs.writeFileSync(workingDir + '/node.cmd', cmdShim)
fs.chmodSync(workingDir + '/node.cmd', '0755')
Expand Down

0 comments on commit aac8730

Please sign in to comment.