mirror of
https://github.com/cmderdev/cmder.git
synced 2025-07-05 11:33:37 +08:00
add setlocal
This commit is contained in:
16
vendor/lib/lib_path.cmd
vendored
16
vendor/lib/lib_path.cmd
vendored
@ -77,24 +77,24 @@ exit /b
|
||||
set OLD_PATH=%PATH%
|
||||
|
||||
setlocal enabledelayedexpansion
|
||||
if "%found%" == "0" (
|
||||
echo "%path%"|%WINDIR%\System32\findstr >nul /I /R /C:";%find_query%;"
|
||||
if "!found!" == "0" (
|
||||
echo "!path!"|!WINDIR!\System32\findstr >nul /I /R /C:";!find_query!;"
|
||||
call :set_found
|
||||
)
|
||||
%lib_console% debug_output :enhance_path "Env Var INSIDE PATH %find_query% - found=%found%"
|
||||
!lib_console! debug_output :enhance_path "Env Var INSIDE PATH !find_query! - found=!found!"
|
||||
|
||||
if /i "%position%" == "append" (
|
||||
if /i "!position!" == "append" (
|
||||
if "!found!" == "0" (
|
||||
echo "%path%"|%WINDIR%\System32\findstr >nul /I /R /C:";%find_query%\"$"
|
||||
echo "!path!"|!WINDIR!\System32\findstr >nul /I /R /C:";!find_query!\"$"
|
||||
call :set_found
|
||||
)
|
||||
%lib_console% debug_output :enhance_path "Env Var END PATH %find_query% - found=!found!"
|
||||
!lib_console! debug_output :enhance_path "Env Var END PATH !find_query! - found=!found!"
|
||||
) else (
|
||||
if "!found!" == "0" (
|
||||
echo "%path%"|%WINDIR%\System32\findstr >nul /I /R /C:"^\"%find_query%;"
|
||||
echo "!path!"|!WINDIR!\System32\findstr >nul /I /R /C:"^\"!find_query!;"
|
||||
call :set_found
|
||||
)
|
||||
%lib_console% debug_output :enhance_path "Env Var BEGIN PATH %find_query% - found=!found!"
|
||||
!lib_console! debug_output :enhance_path "Env Var BEGIN PATH !find_query! - found=!found!"
|
||||
)
|
||||
endlocal & set found=%found%
|
||||
|
||||
|
Reference in New Issue
Block a user