mirror of
https://github.com/cmderdev/cmder.git
synced 2024-11-10 17:59:11 +08:00
fixed - not running user-aliases.cmd if aliases variable is overridden in profile.d
This commit is contained in:
parent
d5a1ce628c
commit
86dd077b9d
18
vendor/init.bat
vendored
18
vendor/init.bat
vendored
@ -77,27 +77,25 @@ popd
|
||||
:: Allows user to override default aliases store using profile.d
|
||||
:: scripts run above. Note: If overriding default aliases file
|
||||
:: in profile.d the aliases must also be loaded in profile.d.
|
||||
set user-aliases=%CMDER_ROOT%\config\user-aliases.cmd
|
||||
if not defined aliases (
|
||||
set aliases=%CMDER_ROOT%\config\user-aliases.cmd
|
||||
set aliases=%user-aliases%
|
||||
)
|
||||
|
||||
:: Using default cmder user-aliases.cmd store.
|
||||
if "%aliases%" == "%CMDER_ROOT%\config\user-aliases.cmd" (
|
||||
:: make sure we have an example file
|
||||
if not exist "%aliases%" (
|
||||
echo Creating intial aliases in "%aliases%"...
|
||||
copy "%CMDER_ROOT%\vendor\user-aliases.cmd.example" "%aliases%"
|
||||
if not exist "%user-aliases%" (
|
||||
echo Creating intial user-aliases store in "%user-aliases%"...
|
||||
copy "%CMDER_ROOT%\vendor\user-aliases.cmd.example" "%user-aliases%"
|
||||
)
|
||||
|
||||
:: Update old 'aliases' to new self executing 'user-aliases.cmd'
|
||||
:: Update old 'user-aliases' to new self executing 'user-aliases.cmd'
|
||||
if exist "%CMDER_ROOT%\config\aliases" (
|
||||
echo Updating old "%CMDER_ROOT%\config\aliases" to new format...
|
||||
type "%CMDER_ROOT%\config\aliases" >> "%aliases%" && del "%CMDER_ROOT%\config\aliases"
|
||||
type "%CMDER_ROOT%\config\aliases" >> "%user-aliases%" && del "%CMDER_ROOT%\config\aliases"
|
||||
)
|
||||
|
||||
:: Add aliases to the environment
|
||||
call "%aliases%"
|
||||
)
|
||||
call "%user-aliases%"
|
||||
|
||||
:: See vendor\git-for-windows\README.portable for why we do this
|
||||
:: Basically we need to execute this post-install.bat because we are
|
||||
|
Loading…
Reference in New Issue
Block a user