Skip to content

Commit aac8730

Browse files
isaacsbcoe
authored andcommitted
fix(win32): handle cases where "node" is quoted (#102)
1 parent 7931ab5 commit aac8730

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

index.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,8 +417,13 @@ function setup (argv, env) {
417417
var cmdShim =
418418
'@echo off\r\n' +
419419
'SETLOCAL\r\n' +
420+
'CALL :find_dp0\r\n' +
420421
'SET PATHEXT=%PATHEXT:;.JS;=;%\r\n' +
421-
'"' + process.execPath + '"' + ' "%~dp0\\.\\node" %*\r\n'
422+
'"' + process.execPath + '"' + ' "%dp0%node" %*\r\n' +
423+
'EXIT /b %errorlevel%\r\n'+
424+
':find_dp0\r\n' +
425+
'SET dp0=%~dp0\r\n' +
426+
'EXIT /b\r\n'
422427

423428
fs.writeFileSync(workingDir + '/node.cmd', cmdShim)
424429
fs.chmodSync(workingDir + '/node.cmd', '0755')

0 commit comments

Comments
 (0)