mirror of
https://github.com/cmderdev/cmder.git
synced 2025-06-15 22:27:51 +08:00
fix path with ! in dir
This commit is contained in:
31
vendor/lib/lib_base.cmd
vendored
31
vendor/lib/lib_base.cmd
vendored
@ -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
|
||||
|
8
vendor/lib/lib_git.cmd
vendored
8
vendor/lib/lib_git.cmd
vendored
@ -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
|
||||
|
19
vendor/lib/lib_path.cmd
vendored
19
vendor/lib/lib_path.cmd
vendored
@ -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%"
|
||||
|
Reference in New Issue
Block a user