You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Disclaimer: I am not that experienced with cmd scripting
After updating to the latest npm, some of our scripts broke. I traced this to the change in #26, which always quotes the executable name (even if it is just node). This seems to cause issues for some paths (The system cannot find the path specified.)
Proposed fix (using tslint as an example):
@ECHO off
SETLOCAL
CALL :find_dp0
SET _maybeQuote="
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET _maybeQuote=
SET PATHEXT=%PATHEXT:;.JS;=;%
)
%_maybeQuote%%_prog%%_maybeQuote% "%dp0%\..\tslint\bin\tslint" %*
ENDLOCAL
EXIT /b %errorlevel%
:find_dp0
SET dp0=%~dp0
EXIT /b
For the %dp0% case, this resolves to "%dp0%\node.exe" "%dp0%\..\tslint\bin\tslint" %*
otherwise, it resolves to node "%dp0%\..\tslint\bin\tslint" %*
Effectively, we only use quotes around the node executable when we use .bin\node.exe
The text was updated successfully, but these errors were encountered:
Disclaimer: I am not that experienced with cmd scripting
After updating to the latest npm, some of our scripts broke. I traced this to the change in #26, which always quotes the executable name (even if it is just
node
). This seems to cause issues for some paths (The system cannot find the path specified.
)Proposed fix (using tslint as an example):
For the %dp0% case, this resolves to
"%dp0%\node.exe" "%dp0%\..\tslint\bin\tslint" %*
otherwise, it resolves to
node "%dp0%\..\tslint\bin\tslint" %*
Effectively, we only use quotes around the node executable when we use
.bin\node.exe
The text was updated successfully, but these errors were encountered: