11@ echo off
22
33call " %~dp0 lib_base.cmd"
4- call " %% ~dp0lib_console"
4+ call " %~dp0 lib_console.cmd "
55set lib_path = call " %~dp0 lib_path.cmd"
66
77if " %~1 " == " /h" (
88 %lib_base% help " %~0 "
9- ) else if " %1 " neq " " (
9+ ) else if " %~ 1 " neq " " (
1010 call :%*
1111)
1212
@@ -48,7 +48,7 @@ exit /b
4848 set " add_path = %~1 "
4949 ) else (
5050 %print_error% " You must specify a directory to add to the path!"
51- exit 1
51+ exit /b 1
5252 )
5353
5454 if " %~2 " neq " " if /i " %~2 " == " append" (
@@ -72,7 +72,7 @@ exit /b
7272 set " PATH = %add_to_path% ;%PATH% "
7373 )
7474 goto :end_enhance_path
75- ) else if " add_to_path" equ " " (
75+ ) else if " % add_to_path% " equ " " (
7676 goto :end_enhance_path
7777 )
7878
@@ -84,20 +84,20 @@ exit /b
8484
8585 setlocal enabledelayedexpansion
8686 if " !found! " == " 0" (
87- echo " !path ! " | !WINDIR! \System32\findstr > nul /I /R /C:" ;!find_query! ;"
87+ echo " !PATH ! " | !WINDIR! \System32\findstr > nul /I /R /C:" ;!find_query! ;"
8888 call :set_found
8989 )
9090 %print_debug% :enhance_path " Env Var INSIDE PATH !find_query! - found=!found! "
9191
9292 if /i " !position! " == " append" (
9393 if " !found! " == " 0" (
94- echo " !path ! " | !WINDIR! \System32\findstr > nul /I /R /C:" ;!find_query! \" $"
94+ echo " !PATH ! " | !WINDIR! \System32\findstr > nul /I /R /C:" ;!find_query! \" $"
9595 call :set_found
9696 )
9797 %print_debug% :enhance_path " Env Var END PATH !find_query! - found=!found! "
9898 ) else (
9999 if " !found! " == " 0" (
100- echo " !path ! " | !WINDIR! \System32\findstr > nul /I /R /C:" ^\" !find_query! ;"
100+ echo " !PATH ! " | !WINDIR! \System32\findstr > nul /I /R /C:" ^\" !find_query! ;"
101101 call :set_found
102102 )
103103 %print_debug% :enhance_path " Env Var BEGIN PATH !find_query! - found=!found! "
@@ -119,7 +119,7 @@ exit /b
119119 :end_enhance_path
120120 set " PATH = %PATH:;; =; % "
121121
122- REM echo %path% | "C:\Users\dgames\cmder - dev\vendor\git-for-windows\usr\bin\wc" -c
122+ REM echo %PATH% | wc -c
123123 if " %fast_init% " == " 1" exit /b
124124
125125 if not " %OLD_PATH:~0 ,3000 % " == " %OLD_PATH:~0 ,3001 % " goto :toolong
@@ -142,7 +142,7 @@ exit /b
142142 exit /b
143143
144144 :changed
145- %print_debug% :enhance_path " END Env Var - PATH=%path % "
145+ %print_debug% :enhance_path " END Env Var - PATH=%PATH % "
146146 %print_debug% :enhance_path " Env Var %find_query% - found=%found% "
147147 exit /b
148148
@@ -190,7 +190,7 @@ exit /b
190190 set " add_path = %~1 "
191191 ) else (
192192 %print_error% " You must specify a directory to add to the path!"
193- exit 1
193+ exit /b 1
194194 )
195195
196196 set " depth = %~2 "
0 commit comments