1
0
mirror of https://github.com/skywind3000/z.lua synced 2026-03-18 21:59:49 +00:00

recognize %_ZL_CD% in cmd.exe

This commit is contained in:
skywind3000
2022-01-30 10:55:40 +08:00
parent 786225005c
commit 3c88f8d8fa
2 changed files with 13 additions and 5 deletions

8
z.cmd
View File

@@ -120,8 +120,12 @@ rem -- Exploits variable expansion and the pushd stack to set the current
rem -- directory without leaking a pushd.
popd
setlocal
set NewPath=%CD%
endlocal & popd & cd /d "%NewPath%"
set "NewPath=%CD%"
set "CDCmd=cd /d"
if /i not "%_ZL_CD%"=="" (
set "CDCmd=%_ZL_CD%"
)
endlocal & popd & %CDCmd% "%NewPath%"
:end
echo.