mirror of
https://github.com/cmderdev/cmder.git
synced 2024-11-10 09:49:12 +08:00
spacing
This commit is contained in:
parent
783cf68d10
commit
f362ba8dba
10
vendor/bin/alias.cmd
vendored
10
vendor/bin/alias.cmd
vendored
@ -81,9 +81,6 @@ set alias_name=!alias_name:~1!
|
||||
:: trailing quotes added while validating
|
||||
set alias_value=!alias_value:~0,-1!
|
||||
|
||||
:: '.' escaped
|
||||
set alias_name_esc=!alias_name:.=\.!
|
||||
|
||||
::remove spaces
|
||||
set _temp=%alias_name: =%
|
||||
|
||||
@ -94,7 +91,7 @@ if not ["%_temp%"] == ["%alias_name%"] (
|
||||
)
|
||||
|
||||
:: replace already defined alias
|
||||
%WINDIR%\System32\findstr /v /i "^%alias_name_esc%=" "%ALIASES%" >> "%ALIASES%.tmp"
|
||||
%WINDIR%\System32\findstr /b /l /v /i "%alias_name%=" "%ALIASES%" >> "%ALIASES%.tmp"
|
||||
echo %alias_name%=%alias_value% >> "%ALIASES%.tmp" && type "%ALIASES%.tmp" > "%ALIASES%" & @del /f /q "%ALIASES%.tmp"
|
||||
doskey /macrofile="%ALIASES%"
|
||||
endlocal
|
||||
@ -103,10 +100,7 @@ exit /b
|
||||
:p_del
|
||||
set del_alias=%~1
|
||||
|
||||
:: '.' escaped
|
||||
set del_alias_esc=!del_alias:.=\.!
|
||||
|
||||
%WINDIR%\System32\findstr /v /i "^%del_alias_esc%=" "%ALIASES%" >> "%ALIASES%.tmp"
|
||||
%WINDIR%\System32\findstr /b /l /v /i "%del_alias%=" "%ALIASES%" >> "%ALIASES%.tmp"
|
||||
type "%ALIASES%".tmp > "%ALIASES%" & @del /f /q "%ALIASES%.tmp"
|
||||
doskey %del_alias%=
|
||||
doskey /macrofile="%ALIASES%"
|
||||
|
Loading…
Reference in New Issue
Block a user