diff options
-rw-r--r-- | src/rebar_utils.erl | 38 |
1 files changed, 17 insertions, 21 deletions
diff --git a/src/rebar_utils.erl b/src/rebar_utils.erl index 55263a7..34db1df 100644 --- a/src/rebar_utils.erl +++ b/src/rebar_utils.erl @@ -45,7 +45,7 @@ vcs_vsn/3, deprecated/3, deprecated/4, get_deprecated_global/4, get_deprecated_global/5, - get_experimental_global/3, + get_experimental_global/3, get_experimental_local/3, get_deprecated_list/4, get_deprecated_list/5, get_deprecated_local/4, get_deprecated_local/5, delayed_halt/1, @@ -217,28 +217,14 @@ get_deprecated_global(Config, OldOpt, NewOpt, When) -> get_deprecated_global(Config, OldOpt, NewOpt, undefined, When). get_deprecated_global(Config, OldOpt, NewOpt, Default, When) -> - case rebar_config:get_global(Config, NewOpt, Default) of - Default -> - case rebar_config:get_global(Config, OldOpt, Default) of - Default -> - Default; - Old -> - deprecated(OldOpt, NewOpt, When), - Old - end; - New -> - New - end. + get_deprecated_3(fun rebar_config:get_global/3, + Config, OldOpt, NewOpt, Default, When). get_experimental_global(Config, Opt, Default) -> - Val = rebar_config:get_global(Config, Opt, Default), - case Val of - Default -> - Default; - Val -> - ?CONSOLE("NOTICE: Using experimental option '~p'~n", [Opt]), - Val - end. + get_experimental_3(fun rebar_config:get_global/3, Config, Opt, Default). + +get_experimental_local(Config, Opt, Default) -> + get_experimental_3(fun rebar_config:get_local/3, Config, Opt, Default). get_deprecated_list(Config, OldOpt, NewOpt, When) -> get_deprecated_list(Config, OldOpt, NewOpt, undefined, When). @@ -350,6 +336,16 @@ get_deprecated_3(Get, Config, OldOpt, NewOpt, Default, When) -> New end. +get_experimental_3(Get, Config, Opt, Default) -> + Val = Get(Config, Opt, Default), + case Val of + Default -> + Default; + Val -> + ?CONSOLE("NOTICE: Using experimental option '~p'~n", [Opt]), + Val + end. + %% We do the shell variable substitution ourselves on Windows and hope that the %% command doesn't use any other shell magic. patch_on_windows(Cmd, Env) -> |