From aac8730b495d471f935d86a92d422b8fc930caed Mon Sep 17 00:00:00 2001 From: isaacs Date: Fri, 23 Aug 2019 12:52:45 -0700 Subject: [PATCH] fix(win32): handle cases where "node" is quoted (#102) --- index.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 30a2d32..39f8bd2 100644 --- a/index.js +++ b/index.js @@ -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')