mirror of
https://github.com/cmderdev/cmder.git
synced 2024-11-10 17:59:11 +08:00
Merge pull request #874 from daxgames/process_profile.d_sooner
Process profile.d scripts before adding user aliases
This commit is contained in:
commit
964f18c66c
26
vendor/init.bat
vendored
26
vendor/init.bat
vendored
@ -61,6 +61,18 @@ if defined GIT_INSTALL_ROOT (
|
|||||||
:: Enhance Path
|
:: Enhance Path
|
||||||
set "PATH=%CMDER_ROOT%\bin;%PATH%;%CMDER_ROOT%\"
|
set "PATH=%CMDER_ROOT%\bin;%PATH%;%CMDER_ROOT%\"
|
||||||
|
|
||||||
|
:: Drop *.bat and *.cmd files into "%CMDER_ROOT%\config\profile.d"
|
||||||
|
:: to run them at startup.
|
||||||
|
if not exist "%CMDER_ROOT%\config\profile.d" (
|
||||||
|
mkdir "%CMDER_ROOT%\config\profile.d"
|
||||||
|
)
|
||||||
|
|
||||||
|
pushd "%CMDER_ROOT%\config\profile.d"
|
||||||
|
for /f "usebackq" %%x in ( `dir /b *.bat *.cmd 2^>nul` ) do (
|
||||||
|
REM echo Calling %CMDER_ROOT%\config\profile.d\%%x...
|
||||||
|
call "%CMDER_ROOT%\config\profile.d\%%x"
|
||||||
|
)
|
||||||
|
popd
|
||||||
|
|
||||||
:: make sure we have an example file
|
:: make sure we have an example file
|
||||||
if not exist "%CMDER_ROOT%\config\aliases" (
|
if not exist "%CMDER_ROOT%\config\aliases" (
|
||||||
@ -90,20 +102,6 @@ if defined CMDER_START (
|
|||||||
cd /d "%CMDER_START%"
|
cd /d "%CMDER_START%"
|
||||||
)
|
)
|
||||||
|
|
||||||
:: Drop *.bat and *.cmd files into "%CMDER_ROOT%\config\profile.d"
|
|
||||||
:: to run them at startup.
|
|
||||||
if not exist "%CMDER_ROOT%\config\profile.d" (
|
|
||||||
mkdir "%CMDER_ROOT%\config\profile.d"
|
|
||||||
)
|
|
||||||
|
|
||||||
pushd "%CMDER_ROOT%\config\profile.d"
|
|
||||||
for /f "usebackq" %%x in ( `dir /b *.bat *.cmd 2^>nul` ) do (
|
|
||||||
REM echo Calling %CMDER_ROOT%\config\profile.d\%%x...
|
|
||||||
call "%CMDER_ROOT%\config\profile.d\%%x"
|
|
||||||
)
|
|
||||||
popd
|
|
||||||
|
|
||||||
|
|
||||||
if exist "%CMDER_ROOT%\config\user-profile.cmd" (
|
if exist "%CMDER_ROOT%\config\user-profile.cmd" (
|
||||||
rem create this file and place your own command in there
|
rem create this file and place your own command in there
|
||||||
call "%CMDER_ROOT%\config\user-profile.cmd"
|
call "%CMDER_ROOT%\config\user-profile.cmd"
|
||||||
|
Loading…
Reference in New Issue
Block a user