mirror of
https://github.com/cmderdev/cmder.git
synced 2025-04-13 21:22:32 +08:00
Fix quotation for aliases variable
This commit is contained in:
parent
30ddd53288
commit
01849c3365
@ -1,6 +1,6 @@
|
|||||||
@echo off
|
@echo off
|
||||||
|
|
||||||
set ALIASES="%CMDER_ROOT%\config\aliases"
|
set ALIASES=%CMDER_ROOT%\config\aliases
|
||||||
|
|
||||||
if ["%*"] == [""] echo Use /? for help & echo. & goto :p_show
|
if ["%*"] == [""] echo Use /? for help & echo. & goto :p_show
|
||||||
if ["%1"] == ["/?"] goto:p_help
|
if ["%1"] == ["/?"] goto:p_help
|
||||||
@ -21,25 +21,25 @@ if not ["%_temp%"] == ["%_temp2%"] (
|
|||||||
)
|
)
|
||||||
|
|
||||||
:: replace already defined alias
|
:: replace already defined alias
|
||||||
findstr /b /v /i "%_temp%=" %ALIASES% >> %ALIASES%.tmp
|
findstr /b /v /i "%_temp%=" "%ALIASES%" >> "%ALIASES%.tmp"
|
||||||
echo %* >> %ALIASES%.tmp && type %ALIASES%.tmp > %ALIASES% & @del /f /q %ALIASES%.tmp
|
echo %* >> "%ALIASES%.tmp" && type "%ALIASES%.tmp" > "%ALIASES%" & @del /f /q "%ALIASES%.tmp"
|
||||||
doskey /macrofile=%ALIASES%
|
doskey /macrofile="%ALIASES%"
|
||||||
endlocal
|
endlocal
|
||||||
goto:eof
|
goto:eof
|
||||||
|
|
||||||
:p_del
|
:p_del
|
||||||
findstr /b /v /i "%2=" %ALIASES% >> %ALIASES%.tmp
|
findstr /b /v /i "%2=" "%ALIASES%" >> "%ALIASES%.tmp"
|
||||||
type %ALIASES%.tmp > %ALIASES% & @del /f /q %ALIASES%.tmp
|
type "%ALIASES%".tmp > "%ALIASES%" & @del /f /q "%ALIASES%.tmp"
|
||||||
doskey /macrofile=%ALIASES%
|
doskey /macrofile=%ALIASES%
|
||||||
goto:eof
|
goto:eof
|
||||||
|
|
||||||
:p_reload
|
:p_reload
|
||||||
doskey /macrofile=%ALIASES%
|
doskey /macrofile="%ALIASES%"
|
||||||
echo Aliases reloaded
|
echo Aliases reloaded
|
||||||
goto:eof
|
goto:eof
|
||||||
|
|
||||||
:p_show
|
:p_show
|
||||||
type %ALIASES% || echo No aliases found at %ALIASES%
|
type "%ALIASES%" || echo No aliases found at "%ALIASES%"
|
||||||
goto :eof
|
goto :eof
|
||||||
|
|
||||||
:p_help
|
:p_help
|
||||||
|
Loading…
x
Reference in New Issue
Block a user