Browse Source

Port env var expension fix from rebar2

See https://github.com/rebar/rebar/pull/458
pull/188/head
Fred Hebert 10 years ago
parent
commit
a8ceafbf4c
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      src/rebar_utils.erl

+ 1
- 1
src/rebar_utils.erl View File

@ -293,7 +293,7 @@ expand_env_variable(InStr, VarName, RawVarValue) ->
VarValue = re:replace(RawVarValue, "\\\\", "\\\\\\\\", ReOpts),
%% Use a regex to match/replace:
%% Given variable "FOO": match $FOO\s | $FOOeol | ${FOO}
RegEx = io_lib:format("\\\$(~s(\\s|$)|{~s})", [VarName, VarName]),
RegEx = io_lib:format("\\\$(~s(\\W|$)|{~s})", [VarName, VarName]),
re:replace(InStr, RegEx, [VarValue, "\\2"], ReOpts)
end.

Loading…
Cancel
Save