summaryrefslogtreecommitdiff
path: root/src/rebar.erl
diff options
context:
space:
mode:
Diffstat (limited to 'src/rebar.erl')
-rw-r--r--src/rebar.erl15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/rebar.erl b/src/rebar.erl
index 48a3ac6..3560772 100644
--- a/src/rebar.erl
+++ b/src/rebar.erl
@@ -30,7 +30,8 @@
run/2,
help/0,
parse_args/1,
- version/0]).
+ version/0,
+ log_level/1]).
-include("rebar.hrl").
@@ -69,7 +70,6 @@ main(Args) ->
%% Erlang-API entry point
run(BaseConfig, Commands) ->
_ = application:load(rebar),
- ok = rebar_log:init(api, BaseConfig),
run_aux(BaseConfig, Commands).
%% ====================================================================
@@ -156,12 +156,12 @@ init_config({Options, _NonOptArgs}) ->
init_config1(BaseConfig) ->
%% Determine the location of the rebar executable; important for pulling
%% resources out of the escript
- ScriptName = filename:absname(escript:script_name()),
- BaseConfig1 = rebar_state:set(BaseConfig, escript, ScriptName),
- ?DEBUG("Rebar location: ~p\n", [ScriptName]),
+ %ScriptName = filename:absname(escript:script_name()),
+ %BaseConfig1 = rebar_state:set(BaseConfig, escript, ScriptName),
+ %?DEBUG("Rebar location: ~p\n", [ScriptName]),
%% Note the top-level directory for reference
AbsCwd = filename:absname(rebar_utils:get_cwd()),
- rebar_state:set(BaseConfig1, base_dir, AbsCwd).
+ rebar_state:set(BaseConfig, base_dir, AbsCwd).
run_aux(BaseConfig, Commands) ->
%% Make sure crypto is running
@@ -176,9 +176,10 @@ run_aux(BaseConfig, Commands) ->
[Command | Args] = Commands,
CommandAtom = list_to_atom(Command),
- BaseConfig1 = init_config1(BaseConfig),
+ %BaseConfig1 = init_config1(BaseConfig),
%% Process each command, resetting any state between each one
+ BaseConfig1 = rebar_state:set(BaseConfig, base_dir, filename:absname(rebar_state:dir(BaseConfig))),
{ok, Providers} = application:get_env(rebar, providers),
BaseConfig2 = rebar_state:create_logic_providers(Providers, BaseConfig1),
rebar_core:process_command(rebar_state:command_args(BaseConfig2, Args), CommandAtom),