summaryrefslogtreecommitdiff
path: root/src/rebar_dir.erl
diff options
context:
space:
mode:
Diffstat (limited to 'src/rebar_dir.erl')
-rw-r--r--src/rebar_dir.erl7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/rebar_dir.erl b/src/rebar_dir.erl
index 7903ed5..7a12eeb 100644
--- a/src/rebar_dir.erl
+++ b/src/rebar_dir.erl
@@ -1,6 +1,7 @@
-module(rebar_dir).
-export([base_dir/1,
+ profile_dir/2,
deps_dir/1,
deps_dir/2,
checkouts_dir/1,
@@ -24,7 +25,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 +38,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)).