diff options
author | Fred Hebert <mononcqc@ferd.ca> | 2019-08-12 12:27:57 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-12 12:27:57 -0400 |
commit | b1f8e3dfadb6aae8d1efcd8939ccb0c26cf03fab (patch) | |
tree | bbea88d606a668871a94d7623b6f78b213c3ecce /src | |
parent | 6abe440ec550dc91354456417d03d5b77dd7adfe (diff) | |
parent | 9402857f5527e300bf28b7e3744bef3fc88f3379 (diff) |
Merge pull request #2136 from tsloughter/env-base-dir
support REBAR_BASE_DIR for setting the base_dir
Diffstat (limited to 'src')
-rw-r--r-- | src/rebar3.erl | 8 |
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)), |