Fix #247 (Reported-by: Uvarov Michael)

This commit is contained in:
Tuncer Ayaz 2012-06-17 16:11:59 +02:00
parent d7037165fd
commit 0f961d86c6
2 changed files with 5 additions and 4 deletions

View file

@ -487,8 +487,7 @@ expand_keys_in_value([Key | Rest], Value, Vars) ->
expand_command(TmplName, Env, InFiles, OutFile) -> expand_command(TmplName, Env, InFiles, OutFile) ->
Cmd0 = proplists:get_value(TmplName, Env), Cmd0 = proplists:get_value(TmplName, Env),
Cmd1 = rebar_utils:expand_env_variable(Cmd0, "PORT_IN_FILES", InFiles), Cmd1 = rebar_utils:expand_env_variable(Cmd0, "PORT_IN_FILES", InFiles),
Cmd2 = rebar_utils:expand_env_variable(Cmd1, "PORT_OUT_FILE", OutFile), rebar_utils:expand_env_variable(Cmd1, "PORT_OUT_FILE", OutFile).
re:replace(Cmd2, "\\\$\\w+|\\\${\\w+}", "", [global, {return, list}]).
%% %%
%% Given a string, determine if it is expandable %% Given a string, determine if it is expandable

View file

@ -337,10 +337,12 @@ get_deprecated_3(Get, Config, OldOpt, NewOpt, Default, When) ->
patch_on_windows(Cmd, Env) -> patch_on_windows(Cmd, Env) ->
case os:type() of case os:type() of
{win32,nt} -> {win32,nt} ->
"cmd /q /c " Cmd1 = "cmd /q /c "
++ lists:foldl(fun({Key, Value}, Acc) -> ++ lists:foldl(fun({Key, Value}, Acc) ->
expand_env_variable(Acc, Key, Value) expand_env_variable(Acc, Key, Value)
end, Cmd, Env); end, Cmd, Env),
%% Remove left-over vars
re:replace(Cmd1, "\\\$\\w+|\\\${\\w+}", "", [global, {return, list}]);
_ -> _ ->
Cmd Cmd
end. end.