diff options
Diffstat (limited to 'src/rebar3.erl')
-rw-r--r-- | src/rebar3.erl | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/src/rebar3.erl b/src/rebar3.erl index 879378e..ff0ab6a 100644 --- a/src/rebar3.erl +++ b/src/rebar3.erl @@ -126,14 +126,23 @@ run_aux(State, RawArgs) -> {ok, Providers} = application:get_env(rebar, providers), %% Providers can modify profiles stored in opts, so set default after initializing providers State5 = rebar_state:create_logic_providers(Providers, State4), - State6 = rebar_plugins:top_level_install(State5), - State7 = rebar_state:default(State6, rebar_state:opts(State6)), + %% Initializing project_plugins which can override default providers + State6 = rebar_plugins:project_plugins_install(State5), + State7 = rebar_plugins:top_level_install(State6), + State8 = case os:getenv("REBAR_CACHE_DIR") of + false -> + State7; + ConfigFile -> + rebar_state:set(State7, global_rebar_dir, ConfigFile) + end, + + State9 = rebar_state:default(State8, rebar_state:opts(State8)), {Task, Args} = parse_args(RawArgs), - State8 = rebar_state:code_paths(State7, default, code:get_path()), + State10 = rebar_state:code_paths(State9, default, code:get_path()), - rebar_core:init_command(rebar_state:command_args(State8, Args), Task). + rebar_core:init_command(rebar_state:command_args(State10, Args), Task). init_config() -> %% Initialize logging system @@ -250,10 +259,10 @@ set_global_flag(State, Options, Flag) -> %% global_option_spec_list() -> [ - %% {Name, ShortOpt, LongOpt, ArgSpec, HelpMsg} - {help, $h, "help", undefined, "Print this help."}, - {version, $v, "version", undefined, "Show version information."}, - {task, undefined, undefined, string, "Task to run."} + %% {Name, ShortOpt, LongOpt, ArgSpec, HelpMsg} + {help, $h, "help", undefined, "Print this help."}, + {version, $v, "version", undefined, "Show version information."}, + {task, undefined, undefined, string, "Task to run."} ]. handle_error(rebar_abort) -> |