mirror of
https://github.com/cmderdev/cmder.git
synced 2025-06-13 13:17:55 +08:00
Ensure use the system find and findstr command instead find/findstr from path. Fix #1959
This commit is contained in:
8
vendor/bin/alias.cmd
vendored
8
vendor/bin/alias.cmd
vendored
@ -40,7 +40,7 @@ goto parseargument
|
||||
) else if "%currentarg%" neq "" (
|
||||
if "%~2" equ "" (
|
||||
:: Show the specified alias
|
||||
doskey /macros | findstr /b %currentarg%= && exit /b
|
||||
doskey /macros | %WINDIR%\System32\findstr /b %currentarg%= && exit /b
|
||||
echo insufficient parameters.
|
||||
goto :p_help
|
||||
) else (
|
||||
@ -85,7 +85,7 @@ if not ["%_temp%"] == ["%alias_name%"] (
|
||||
)
|
||||
|
||||
:: replace already defined alias
|
||||
findstr /b /v /i "%alias_name%=" "%ALIASES%" >> "%ALIASES%.tmp"
|
||||
%WINDIR%\System32\findstr /b /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
|
||||
@ -93,7 +93,7 @@ exit /b
|
||||
|
||||
:p_del
|
||||
set del_alias=%~1
|
||||
findstr /b /v /i "%del_alias%=" "%ALIASES%" >> "%ALIASES%.tmp"
|
||||
%WINDIR%\System32\findstr /b /v /i "%del_alias%=" "%ALIASES%" >> "%ALIASES%.tmp"
|
||||
type "%ALIASES%".tmp > "%ALIASES%" & @del /f /q "%ALIASES%.tmp"
|
||||
doskey %del_alias%=
|
||||
doskey /macrofile="%ALIASES%"
|
||||
@ -105,7 +105,7 @@ echo Aliases reloaded
|
||||
exit /b
|
||||
|
||||
:p_show
|
||||
doskey /macros|findstr /v /r "^;=" | sort
|
||||
doskey /macros|%WINDIR%\System32\findstr /v /r "^;=" | sort
|
||||
exit /b
|
||||
|
||||
:p_help
|
||||
|
2
vendor/bin/cexec.cmd
vendored
2
vendor/bin/cexec.cmd
vendored
@ -52,7 +52,7 @@ set "feFlagName=%feFlagName% "
|
||||
:: echo %feCommand%
|
||||
:: echo %feParam%
|
||||
:: echo.
|
||||
echo %CMDER_USER_FLAGS% | find /i "%feFlagName%">nul
|
||||
echo %CMDER_USER_FLAGS% | %WINDIR%\System32\find /i "%feFlagName%">nul
|
||||
if "%ERRORLEVEL%" == "0" (
|
||||
if "%feNOT%" == "false" (
|
||||
endlocal && call %feCommand% %feParam%
|
||||
|
Reference in New Issue
Block a user