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

Fix alias.bat handling "user-aliases.cmd" with spaces #1531

Merged
merged 2 commits into from
Jan 9, 2018
Merged
Changes from 1 commit
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
22 changes: 11 additions & 11 deletions bin/alias.bat
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
@echo off


if "%aliases%" == "" (
set ALIASES=%CMDER_ROOT%\config\user-aliases.cmd
if "%ALIASES%" == "" (
set aliases="%CMDER_ROOT%\config\user-aliases.cmd"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this supposed to be lowercase?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah that looks a bit weird

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can change it to either be upper case or lower case - Command prompt variables are case insensitive.

The original problem was that half the file was using an upper case variant of the name, while the rest was using a lower case variant.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well imo it should be consistent if you change it now, change it everywhere, no?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you change it?

)

setlocal enabledelayedexpansion
Expand Down Expand Up @@ -50,16 +50,16 @@ goto parseargument
)
rem #endregion parseargument

if "%aliases%" neq "%CMDER_ROOT%\config\user-aliases.cmd" (
set _x=!_x:/f %aliases% =!
if "%ALIASES%" neq "%CMDER_ROOT%\config\user-aliases.cmd" (
set _x=!_x:/f "%ALIASES%" =!

if not exist "%aliases%" (
echo ;= @echo off>"%aliases%"
echo ;= rem Call DOSKEY and use this file as the macrofile>>"%aliases%"
echo ;= %%SystemRoot%%\system32\doskey /listsize=1000 /macrofile=%%0%%>>"%aliases%"
echo ;= rem In batch mode, jump to the end of the file>>"%aliases%"
echo ;= goto:eof>>"%aliases%"
echo ;= Add aliases below here>>"%aliases%"
if not exist "%ALIASES%" (
echo ;= @echo off>"%ALIASES%"
echo ;= rem Call DOSKEY and use this file as the macrofile>>"%ALIASES%"
echo ;= %%SystemRoot%%\system32\doskey /listsize=1000 /macrofile=%%0%%>>"%ALIASES%"
echo ;= rem In batch mode, jump to the end of the file>>"%ALIASES%"
echo ;= goto:eof>>"%ALIASES%"
echo ;= Add aliases below here>>"%ALIASES%"
)
)

Expand Down