fix path with ! in dir

This commit is contained in:
Dax T. Games
2019-10-13 10:07:23 -04:00
parent 3a44bc809d
commit 377d97e56a
4 changed files with 73 additions and 68 deletions

View File

@ -65,17 +65,26 @@ exit /b
echo %comspec% | %WINDIR%\System32\find /i "\tcc.exe" > nul && set "CMDER_SHELL=tcc"
echo %comspec% | %WINDIR%\System32\find /i "\tccle" > nul && set "CMDER_SHELL=tccle"
if not defined CMDER_CLINK (
set CMDER_CLINK=1
if "%CMDER_SHELL%" equ "tcc" set CMDER_CLINK=0
if "%CMDER_SHELL%" equ "tccle" set CMDER_CLINK=0
)
set CMDER_CLINK=1
if "%CMDER_SHELL%" equ "tcc" set CMDER_CLINK=0
if "%CMDER_SHELL%" equ "tccle" set CMDER_CLINK=0
if not defined CMDER_ALIASES (
set CMDER_ALIASES=1
if "%CMDER_SHELL%" equ "tcc" set CMDER_ALIASES=0
if "%CMDER_SHELL%" equ "tccle" set CMDER_ALIASES=0
)
set CMDER_ALIASES=1
if "%CMDER_SHELL%" equ "tcc" set CMDER_ALIASES=0
if "%CMDER_SHELL%" equ "tccle" set CMDER_ALIASES=0
exit /b
:update_legacy_aliases
type "%user_aliases%" | %WINDIR%\System32\findstr /i ";= Add aliases below here" >nul
if "%errorlevel%" == "1" (
echo Creating initial user_aliases store in "%user_aliases%"...
if defined CMDER_USER_CONFIG (
copy "%user_aliases%" "%user_aliases%.old_format"
copy "%CMDER_ROOT%\vendor\user_aliases.cmd.default" "%user_aliases%"
) else (
copy "%user_aliases%" "%user_aliases%.old_format"
copy "%CMDER_ROOT%\vendor\user_aliases.cmd.default" "%user_aliases%"
)
)
exit /b

View File

@ -34,6 +34,8 @@ exit /b
::: GIT_VERSION_[GIT SCOPE] <out> Env variable containing Git semantic version string
:::-------------------------------------------------------------------------------
echo CMDER_HERE1.2
setlocal enabledelayedexpansion
:: clear the variables
set GIT_VERSION_%~1=
@ -88,11 +90,8 @@ exit /b
::: [SCOPE]_BUILD <out> Scoped Build version.
:::-------------------------------------------------------------------------------
setlocal enabledelayedexpansion
:: process a `x.x.x.xxxx.x` formatted string
set "%~1_MAJOR="
set "%~1_MINOR="
set "%~1_PATCH="
set "%~1_BUILD="
%lib_console% debug_output :parse_version "ARGV[1]=%~1, ARGV[2]=%~2"
for /F "tokens=1-3* delims=.,-" %%A in ("%2") do (
set "%~1_MAJOR=%%A"
@ -101,6 +100,7 @@ exit /b
set "%~1_BUILD=%%D"
)
endlocal & set "%~1_MAJOR=!%~1_MAJOR!" & set "%~1_MINOR=!%~1_MINOR!" & set "%~1_PATCH=!%~1_PATCH!" & set "%~1_BUILD=!%~1_BUILD!"
exit /b
:validate_version

View File

@ -38,7 +38,6 @@ exit /b
::: path <out> Sets the path env variable if required.
:::-------------------------------------------------------------------------------
setlocal enabledelayedexpansion
if "%~1" neq "" (
set "add_path=%~1"
) else (
@ -58,9 +57,15 @@ exit /b
) else (
set "PATH=%add_path%;%PATH%"
)
goto :end_enhance_path
)
set "PATH=%PATH:;;=;%"
if "%fast_init%" == "1" (
exit /b
)
setlocal enabledelayedexpansion
set found=0
set "find_query=%add_path%"
set "find_query=%find_query:\=\\%"
@ -125,7 +130,6 @@ exit /b
:::.
::: path <out> Sets the path env variable if required.
:::-------------------------------------------------------------------------------
setlocal enabledelayedexpansion
if "%~1" neq "" (
set "add_path=%~1"
) else (
@ -147,10 +151,15 @@ exit /b
if "%fast_init%" == "1" (
call :enhance_path "%add_path%" %position%
goto :end_enhance_path_recursive
)
if "%depth%" == "" set depth=0
set "PATH=%PATH:;;=;%"
if "%fast_init%" == "1" (
exit /b
)
setlocal enabledelayedexpansion
if "%depth%" == "" set depth=0
%lib_console% debug_output :enhance_path_recursive "Env Var - add_path=%add_path%"
%lib_console% debug_output :enhance_path_recursive "Env Var - position=%position%"