summaryrefslogtreecommitdiff
path: root/src/rebar_utils.erl
diff options
context:
space:
mode:
Diffstat (limited to 'src/rebar_utils.erl')
-rw-r--r--src/rebar_utils.erl4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/rebar_utils.erl b/src/rebar_utils.erl
index 88c0c25..a32adfd 100644
--- a/src/rebar_utils.erl
+++ b/src/rebar_utils.erl
@@ -191,11 +191,11 @@ expand_env_variable(InStr, VarName, RawVarValue) ->
%% No variables to expand
InStr;
_ ->
- ReOpts = [global, {return, list}],
VarValue = re:replace(RawVarValue, "\\\\", "\\\\\\\\", [global]),
%% Use a regex to match/replace:
- %% $FOO\s | ${FOO} | $FOO eol
+ %% Given variable "FOO": match $FOO\s | $FOOeol | ${FOO}
RegEx = io_lib:format("\\\$(~s(\\s|$)|{~s})", [VarName, VarName]),
+ ReOpts = [global, {return, list}],
re:replace(InStr, RegEx, VarValue ++ "\\2", ReOpts)
end.