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 shell hook expansion on windows #1918

Merged
merged 1 commit into from
Oct 18, 2018
Merged

Conversation

ferd
Copy link
Collaborator

@ferd ferd commented Oct 18, 2018

Dollar Variable expansion ($VAR) was inadvertently disabled for
windows variables, although %VARIABLES% already worked. This reduced the
portability of hooks in general.

This was disabled more than four years ago, I'm in fact not quite sure it had ever
worked as intended since expand_sh_flag/1 wrapped the env value in a way that
proplists:get_env/3 always returned []. This is re-expanding them. This might
actually be a bit risky to enable at this point.

Additionally, tests would fail on windows due to bad quoting of paths:
the path C:/a/b/c would fail when passed to the command
cmd /q /c C:/a/b/c because it would interpret /a /b and /c as 3
options. Using quotes makes the tests pass. This one fix should at least
be safe on its own, but I'm curious as to how it ever passed without
the var expansion.

Dollar Variable expansion (`$VAR`) was inadvertently disabled for
windows variables, although %VARIABLES% already worked. This reduced the
portability of hooks in general.

Additionally, tests would fail on windows due to bad quoting of paths:
the path C:/a/b/c would fail when passed to the command
`cmd /q /c C:/a/b/c` because it would interpret /a /b and /c as 3
options. Using quotes makes the tests pass.
@ferd ferd merged commit 384d8cc into erlang:master Oct 18, 2018
@ferd ferd deleted the fix-hooks-on-windows branch October 18, 2018 20:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants