summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFred Hebert <mononcqc@ferd.ca>2015-03-03 16:31:38 -0500
committerFred Hebert <mononcqc@ferd.ca>2015-03-03 16:31:38 -0500
commit5fb6bc680a153766184f1f4f9f30b5cc9484d98d (patch)
treedfffe5cd9ee4445a655a0784aa437922bdc07cac /src
parentc43641654fe808dd4e6b49b9a770493db1c4e96b (diff)
parentd72812cb5f0b7618c3c3678b6a4f357752a5bcac (diff)
Merge pull request #210 from talentdeficit/shorter_build_dirs
shorter build dirs
Diffstat (limited to 'src')
-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 fd80fa7..628ebd3 100644
--- a/src/rebar_dir.erl
+++ b/src/rebar_dir.erl
@@ -23,7 +23,12 @@
-spec base_dir(rebar_state:t()) -> file:filename_all().
base_dir(State) ->
Profiles = rebar_state:current_profiles(State),
- ProfilesStrings = [ec_cnv:to_list(P) || P <- 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
+ %% of profiles to match order passed to `as`
+ ["default"|Rest] -> lists:reverse(Rest)
+ end,
ProfilesDir = string:join(ProfilesStrings, "+"),
filename:join(rebar_state:get(State, base_dir, ?DEFAULT_BASE_DIR), ProfilesDir).