summaryrefslogtreecommitdiff
path: root/src/rebar3.erl
diff options
context:
space:
mode:
authorTristan Sloughter <t@crashfast.com>2019-08-11 14:01:51 -0600
committerTristan Sloughter <t@crashfast.com>2019-08-11 14:01:51 -0600
commit9402857f5527e300bf28b7e3744bef3fc88f3379 (patch)
treebbea88d606a668871a94d7623b6f78b213c3ecce /src/rebar3.erl
parent6abe440ec550dc91354456417d03d5b77dd7adfe (diff)
support REBAR_BASE_DIR for setting the base_dir
Diffstat (limited to 'src/rebar3.erl')
-rw-r--r--src/rebar3.erl8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/rebar3.erl b/src/rebar3.erl
index a490a15..9112346 100644
--- a/src/rebar3.erl
+++ b/src/rebar3.erl
@@ -151,8 +151,12 @@ run_aux(State, RawArgs) ->
%% bootstrap test profile
State3 = rebar_state:add_to_profile(State2_, test, test_state(State1)),
- %% Process each command, resetting any state between each one
- BaseDir = rebar_state:get(State, base_dir, ?DEFAULT_BASE_DIR),
+ BaseDir = case os:getenv("REBAR_BASE_DIR") of
+ D when D =:= false orelse D =:= "" ->
+ rebar_state:get(State, base_dir, ?DEFAULT_BASE_DIR);
+ Dir ->
+ Dir
+ end,
State4 = rebar_state:set(State3, base_dir,
filename:join(filename:absname(rebar_state:dir(State3)), BaseDir)),