summaryrefslogtreecommitdiff
path: root/src/rebar_dir.erl
diff options
context:
space:
mode:
authorTristan Sloughter <t@crashfast.com>2015-05-17 14:36:03 -0500
committerTristan Sloughter <t@crashfast.com>2015-05-17 14:36:03 -0500
commit3a201230fedb01ba258c291ed56450300caeac56 (patch)
tree77853d81ec2ed2c00be88fa23e7be553484df58c /src/rebar_dir.erl
parent162f0f8f63c99c6a9800ef1911060fad8b257b8b (diff)
install plugins from the global config to ~/.cache/plugins
Diffstat (limited to 'src/rebar_dir.erl')
-rw-r--r--src/rebar_dir.erl13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/rebar_dir.erl b/src/rebar_dir.erl
index a94c72d..8d8a39e 100644
--- a/src/rebar_dir.erl
+++ b/src/rebar_dir.erl
@@ -30,14 +30,15 @@ base_dir(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"];
+ {BaseDir, ProfilesStrings} = case [ec_cnv:to_list(P) || P <- Profiles] of
+ ["global"] -> {?MODULE:global_cache_dir(State), [""]};
+ ["default"] -> {rebar_state:get(State, base_dir, ?DEFAULT_BASE_DIR), ["default"]};
%% drop `default` from the profile dir if it's implicit and reverse order
%% of profiles to match order passed to `as`
- ["default"|Rest] -> Rest
+ ["default"|Rest] -> {rebar_state:get(State, base_dir, ?DEFAULT_BASE_DIR), Rest}
end,
ProfilesDir = string:join(ProfilesStrings, "+"),
- filename:join(rebar_state:get(State, base_dir, ?DEFAULT_BASE_DIR), ProfilesDir).
+ filename:join(BaseDir, ProfilesDir).
-spec deps_dir(rebar_state:t()) -> file:filename_all().
@@ -81,11 +82,11 @@ global_config_dir(State) ->
rebar_state:get(State, global_rebar_dir, filename:join([Home, ".config", "rebar3"])).
global_config(State) ->
- filename:join(global_config_dir(State), "config").
+ filename:join(global_config_dir(State), "rebar.config").
global_config() ->
Home = home_dir(),
- filename:join([Home, ".config", "rebar3", "config"]).
+ filename:join([Home, ".config", "rebar3", "rebar.config"]).
global_cache_dir(State) ->
Home = home_dir(),