We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
The working directory changed by cd after setlocal is not maintained. So process.cwd() returns the wrong location.
The current directory after the cd command should be kept.
cd
$HOME\AppData\Roaming\npm\aaaa.js :
console.log('CWD:', process.cwd());
$HOME\AppData\Roaming\npm\test.cmd :
@ECHO off GOTO start :find_dp0 SET dp0=%~dp0 EXIT /b :start SETLOCAL CALL :find_dp0 IF EXIST "%dp0%\node.exe" ( SET "_prog=%dp0%\node.exe" ) ELSE ( SET "_prog=node" SET PATHEXT=%PATHEXT:;.JS;=;% ) endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\aaaa.js" %*
test.bat:
setlocal cd C:\abcdefg\ test.cmd endlocal
Run test.bat
CWD: C:\Users...\ (Other directory instead of "C:\abcdefg")
cmd-shim/lib/index.js
Line 113 in 4660668
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Is there an existing issue for this?
Current Behavior
The working directory changed by cd after setlocal is not maintained.
So process.cwd() returns the wrong location.
Expected Behavior
The current directory after the
cd
command should be kept.Steps To Reproduce
$HOME\AppData\Roaming\npm\aaaa.js :
$HOME\AppData\Roaming\npm\test.cmd :
test.bat:
Run test.bat
Environment
Source
cmd-shim/lib/index.js
Line 113 in 4660668
The text was updated successfully, but these errors were encountered: