Merge pull request #892 from daxgames/fix_aliases

fixed - not running user-aliases.cmd if aliases variable is overridde…
This commit is contained in:
Benjamin Staneck 2016-03-21 22:55:26 +01:00
commit f9d0050c67

34
vendor/init.bat vendored
View File

@ -29,7 +29,7 @@ if "%PROCESSOR_ARCHITECTURE%"=="x86" (
if not exist "%CMDER_ROOT%\config\settings" ( if not exist "%CMDER_ROOT%\config\settings" (
echo Generating clink initial settings in %CMDER_ROOT%\config\settings echo Generating clink initial settings in %CMDER_ROOT%\config\settings
echo Additional *.lua files in %CMDER_ROOT%\config are loaded on startup. echo Additional *.lua files in %CMDER_ROOT%\config are loaded on startup.
) )
:: Run clink :: Run clink
"%CMDER_ROOT%\vendor\clink\clink_x%architecture%.exe" inject --quiet --profile "%CMDER_ROOT%\config" --scripts "%CMDER_ROOT%\vendor" "%CMDER_ROOT%\vendor\clink\clink_x%architecture%.exe" inject --quiet --profile "%CMDER_ROOT%\config" --scripts "%CMDER_ROOT%\vendor"
@ -77,28 +77,26 @@ popd
:: Allows user to override default aliases store using profile.d :: Allows user to override default aliases store using profile.d
:: scripts run above. Note: If overriding default aliases file :: scripts run above. Note: If overriding default aliases file
:: in profile.d the aliases must also be loaded in profile.d. :: 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 ( if not defined aliases (
set aliases=%CMDER_ROOT%\config\user-aliases.cmd set aliases=%user-aliases%
) )
:: Using default cmder user-aliases.cmd store. :: make sure we have an example file
if "%aliases%" == "%CMDER_ROOT%\config\user-aliases.cmd" ( if not exist "%user-aliases%" (
:: make sure we have an example file echo Creating intial user-aliases store in "%user-aliases%"...
if not exist "%aliases%" ( copy "%CMDER_ROOT%\vendor\user-aliases.cmd.example" "%user-aliases%"
echo Creating intial aliases in "%aliases%"...
copy "%CMDER_ROOT%\vendor\user-aliases.cmd.example" "%aliases%"
)
:: Update old '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"
)
:: Add aliases to the environment
call "%aliases%"
) )
:: 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" >> "%user-aliases%" && del "%CMDER_ROOT%\config\aliases"
)
:: Add aliases to the environment
call "%user-aliases%"
:: See vendor\git-for-windows\README.portable for why we do this :: See vendor\git-for-windows\README.portable for why we do this
:: Basically we need to execute this post-install.bat because we are :: Basically we need to execute this post-install.bat because we are
:: manually extracting the archive rather than executing the 7z sfx :: manually extracting the archive rather than executing the 7z sfx