From 9402857f5527e300bf28b7e3744bef3fc88f3379 Mon Sep 17 00:00:00 2001 From: Tristan Sloughter Date: Sun, 11 Aug 2019 14:01:51 -0600 Subject: support REBAR_BASE_DIR for setting the base_dir --- src/rebar3.erl | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src') 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)), -- cgit v1.1