diff --git a/z.cmd b/z.cmd index fc28d87..3586814 100644 --- a/z.cmd +++ b/z.cmd @@ -69,6 +69,9 @@ if /i "%RunMode%"=="-n" ( for /f "delims=" %%i in ('call "%LuaExe%" "%LuaScript%" --cd %MatchType% %StrictSub% %*') do set "NewPath=%%i" if not "!NewPath!"=="" ( if exist !NewPath!\nul ( + if /i not "%_ZL_ECHO%"=="" ( + echo !NewPath! + ) pushd !NewPath! pushd !NewPath! endlocal diff --git a/z.lua b/z.lua index 949b289..356d7a0 100644 --- a/z.lua +++ b/z.lua @@ -1195,8 +1195,8 @@ _zlua() { else $_ZL_CD "$dest" fi + [ -n "$_ZL_ECHO" ] && pwd fi - [ -n "$_ZL_ECHO" ] && pwd fi } # alias ${_ZL_CMD:-z}='_zlua 2>&1' @@ -1395,6 +1395,9 @@ if /i "%RunMode%"=="-n" ( for /f "delims=" %%i in ('call "%LuaExe%" "%LuaScript%" --cd %MatchType% %StrictSub% %*') do set "NewPath=%%i" if not "!NewPath!"=="" ( if exist !NewPath!\nul ( + if /i not "%_ZL_ECHO%"=="" ( + echo !NewPath! + ) pushd !NewPath! pushd !NewPath! endlocal