summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTristan Sloughter <t@crashfast.com>2014-11-08 11:09:23 -0600
committerTristan Sloughter <t@crashfast.com>2014-11-08 11:09:23 -0600
commit0608e5087b24037874f8c4ef85318944c4081396 (patch)
treeb1f9eacaa9dd9d0fc024644ce7217c6bcea47f42
parentee1214a9a816740188914aaa0ceae3e8719f145f (diff)
prepend base_dir when expanding code path
-rw-r--r--include/rebar.hrl1
-rw-r--r--src/rebar_core.erl5
2 files changed, 4 insertions, 2 deletions
diff --git a/include/rebar.hrl b/include/rebar.hrl
index e84c197..78a3f02 100644
--- a/include/rebar.hrl
+++ b/include/rebar.hrl
@@ -13,6 +13,7 @@
-define(FMT(Str, Args), lists:flatten(io_lib:format(Str, Args))).
+-define(DEFAULT_BASE_DIR, "").
-define(DEFAULT_LIB_DIRS, ["_checkouts", "apps", "lib", "."]).
-define(DEFAULT_DEPS_DIR, "_deps").
-define(DEFAULT_PLUGINS_DIR, "_plugins").
diff --git a/src/rebar_core.erl b/src/rebar_core.erl
index 16d8f07..b2af936 100644
--- a/src/rebar_core.erl
+++ b/src/rebar_core.erl
@@ -70,9 +70,10 @@ do([ProviderName | Rest], State) ->
update_code_path(State) ->
true = rebar_utils:expand_code_path(),
+ BaseDir = rebar_state:get(State, base_dir, ?DEFAULT_BASE_DIR),
LibDirs = rebar_state:get(State, lib_dirs, ?DEFAULT_LIB_DIRS),
- DepsDir = rebar_state:get(State, deps_dir, ?DEFAULT_DEPS_DIR),
- PluginsDir = rebar_state:get(State, plugins_dir, ?DEFAULT_PLUGINS_DIR),
+ DepsDir = filename:join(BaseDir, rebar_state:get(State, deps_dir, ?DEFAULT_DEPS_DIR)),
+ PluginsDir = filename:join(BaseDir, rebar_state:get(State, plugins_dir, ?DEFAULT_PLUGINS_DIR)),
_UpdatedCodePaths = update_code_path_([DepsDir, PluginsDir | LibDirs]).