瀏覽代碼

Rereading system configuration sets up persistent options if possible.

pull/1348/head
Alexander Sedov 8 年之前
父節點
當前提交
6e9503c4f0
共有 1 個檔案被更改,包括 7 行新增1 行删除
  1. +7
    -1
      src/rebar_utils.erl

+ 7
- 1
src/rebar_utils.erl 查看文件

@ -414,8 +414,14 @@ user_agent() ->
?FMT("Rebar/~s (OTP/~s)", [Vsn, otp_release()]).
reread_config(ConfigList) ->
SetEnv = case version_tuple(?MODULE:otp_release()) of
{X, _, _} when X =< 17 ->
fun application:set_env/3;
_ ->
fun (App, Key, Val) -> application:set_env(App, Key, Val, [{persistent, true}]) end
end,
try
[application:set_env(Application, Key, Val)
[SetEnv(Application, Key, Val)
|| Config <- ConfigList,
{Application, Items} <- Config,
{Key, Val} <- Items]

Loading…
取消
儲存