diff options
Diffstat (limited to 'src/rebar_dir.erl')
-rw-r--r-- | src/rebar_dir.erl | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/rebar_dir.erl b/src/rebar_dir.erl index 1885e9a..a94c72d 100644 --- a/src/rebar_dir.erl +++ b/src/rebar_dir.erl @@ -1,8 +1,10 @@ -module(rebar_dir). -export([base_dir/1, + profile_dir/2, deps_dir/1, deps_dir/2, + root_dir/1, checkouts_dir/1, checkouts_dir/2, plugins_dir/1, @@ -24,7 +26,10 @@ -spec base_dir(rebar_state:t()) -> file:filename_all(). base_dir(State) -> - Profiles = rebar_state:current_profiles(State), + profile_dir(State, rebar_state:current_profiles(State)). + +-spec profile_dir(rebar_state:t(), [atom()]) -> file:filename_all(). +profile_dir(State, Profiles) -> ProfilesStrings = case [ec_cnv:to_list(P) || P <- Profiles] of ["default"] -> ["default"]; %% drop `default` from the profile dir if it's implicit and reverse order @@ -34,6 +39,7 @@ base_dir(State) -> ProfilesDir = string:join(ProfilesStrings, "+"), filename:join(rebar_state:get(State, base_dir, ?DEFAULT_BASE_DIR), ProfilesDir). + -spec deps_dir(rebar_state:t()) -> file:filename_all(). deps_dir(State) -> filename:join(base_dir(State), rebar_state:get(State, deps_dir, ?DEFAULT_DEPS_DIR)). @@ -43,7 +49,7 @@ deps_dir(DepsDir, App) -> filename:join(DepsDir, App). root_dir(State) -> - rebar_state:get(State, root_dir, ?DEFAULT_ROOT_DIR). + filename:absname(rebar_state:get(State, root_dir, ?DEFAULT_ROOT_DIR)). -spec checkouts_dir(rebar_state:t()) -> file:filename_all(). checkouts_dir(State) -> |