소스 검색

support base dir and properly reset deps_dir after plugin provider

pull/3/head
Tristan Sloughter 10 년 전
부모
커밋
557de6f8b4
2개의 변경된 파일10개의 추가작업 그리고 7개의 파일을 삭제
  1. +8
    -6
      src/rebar3.erl
  2. +2
    -1
      src/rebar_plugins.erl

+ 8
- 6
src/rebar3.erl 파일 보기

@ -82,7 +82,7 @@ run(BaseState, Command) ->
%% ====================================================================
run(RawArgs) ->
ok = load_rebar_app(),
_ = application:load(rebar),
BaseConfig = init_config(),
case erlang:system_info(version) of
@ -95,10 +95,6 @@ run(RawArgs) ->
{BaseConfig1, _Args1} = set_options(BaseConfig, {[], []}),
run_aux(BaseConfig1, RawArgs).
load_rebar_app() ->
%% Pre-load the rebar app so that we get default configuration
ok = application:load(rebar).
init_config() ->
%% Initialize logging system
Verbosity = log_level(),
@ -158,7 +154,13 @@ run_aux(State, RawArgs) ->
State1 = init_config1(State),
%% Process each command, resetting any state between each one
State2 = rebar_state:set(State1, base_dir, filename:absname(rebar_state:dir(State1))),
State2 = case rebar_state:get(State1, base_dir, undefined) of
undefined ->
rebar_state:set(State1, base_dir, filename:absname(rebar_state:dir(State1)));
Dir ->
rebar_state:set(State1, base_dir, filename:absname(Dir))
end,
{ok, Providers} = application:get_env(rebar, providers),
{ok, PluginProviders, State3} = rebar_plugins:install(State2),

+ 2
- 1
src/rebar_plugins.erl 파일 보기

@ -12,6 +12,7 @@
%% ===================================================================
install(State) ->
DepsDir = rebar_state:get(State, deps_dir, ?DEFAULT_DEPS_DIR),
State1 = rebar_state:set(State, deps_dir, ?DEFAULT_PLUGINS_DIR),
expand_plugins(?DEFAULT_PLUGINS_DIR),
Plugins = rebar_state:get(State1, plugins, []),
@ -19,7 +20,7 @@ install(State) ->
handle_plugin(Plugin, State1)
end, Plugins),
{ok, PluginProviders, rebar_state:set(State1, deps_dir, ?DEFAULT_DEPS_DIR)}.
{ok, PluginProviders, rebar_state:set(State1, deps_dir, DepsDir)}.
handle_plugin(Plugin, State) ->
try

불러오는 중...
취소
저장