Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed - not running user-aliases.cmd if aliases variable is overridde… #892

Merged
merged 1 commit into from
Mar 21, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 16 additions & 18 deletions vendor/init.bat
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ if "%PROCESSOR_ARCHITECTURE%"=="x86" (
if not exist "%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.
)
)

:: Run clink
"%CMDER_ROOT%\vendor\clink\clink_x%architecture%.exe" inject --quiet --profile "%CMDER_ROOT%\config" --scripts "%CMDER_ROOT%\vendor"
Expand Down Expand Up @@ -77,28 +77,26 @@ 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%
)

:: make sure we have an example file
if not exist "%user-aliases%" (
echo Creating intial user-aliases store in "%user-aliases%"...
copy "%CMDER_ROOT%\vendor\user-aliases.cmd.example" "%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%"
)

:: 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
:: Basically we need to execute this post-install.bat because we are
:: manually extracting the archive rather than executing the 7z sfx
Expand Down