add setlocal

This commit is contained in:
Dax T. Games
2020-08-23 08:42:58 -04:00
parent 2cd7632720
commit b1ef763922
2 changed files with 17 additions and 14 deletions

View File

@ -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%