summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/rebar_api.erl20
-rw-r--r--src/rebar_prv_clean.erl2
-rw-r--r--src/rebar_utils.erl5
3 files changed, 24 insertions, 3 deletions
diff --git a/src/rebar_api.erl b/src/rebar_api.erl
index a01391d..3fc7f61 100644
--- a/src/rebar_api.erl
+++ b/src/rebar_api.erl
@@ -5,7 +5,11 @@
-include_lib("providers/include/providers.hrl").
-export([abort/0, abort/2,
console/2,
- debug/2, info/2, warn/2, error/2]).
+ debug/2, info/2, warn/2, error/2,
+ expand_env_variable/3,
+ get_arch/0,
+ wordsize/0]).
+
-export_type([rebar_dict/0, rebar_digraph/0]).
%%%%%%%%%%%%%%%%%%%%%%%
@@ -30,3 +34,17 @@ info(Str, Args) -> ?INFO(Str, Args).
warn(Str, Args) -> ?WARN(Str, Args).
%% @doc logs with severity `error'
error(Str, Args) -> ?ERROR(Str, Args).
+
+%%
+%% Given env. variable FOO we want to expand all references to
+%% it in InStr. References can have two forms: $FOO and ${FOO}
+%% The end of form $FOO is delimited with whitespace or eol
+%%
+expand_env_variable(InStr, VarName, RawVarValue) ->
+ rebar_utils:expand_env_variable(InStr, VarName, RawVarValue).
+
+get_arch() ->
+ rebar_utils:get_arch().
+
+wordsize() ->
+ rebar_utils:wordsize().
diff --git a/src/rebar_prv_clean.erl b/src/rebar_prv_clean.erl
index 8fbc516..0da286b 100644
--- a/src/rebar_prv_clean.erl
+++ b/src/rebar_prv_clean.erl
@@ -37,7 +37,7 @@ do(State) ->
case All of
true ->
- DepsDir = rebar_state:get(State, deps_dir, ?DEFAULT_DEPS_DIR),
+ DepsDir = rebar_dir:deps_dir(State),
DepApps = rebar_app_discover:find_apps([DepsDir], all);
false ->
DepApps = []
diff --git a/src/rebar_utils.erl b/src/rebar_utils.erl
index df25997..d92ab80 100644
--- a/src/rebar_utils.erl
+++ b/src/rebar_utils.erl
@@ -49,7 +49,10 @@
erl_opts/1,
indent/1,
cleanup_code_path/1,
- args_to_tasks/1]).
+ args_to_tasks/1,
+ expand_env_variable/3,
+ get_arch/0,
+ wordsize/0]).
%% for internal use only
-export([otp_release/0]).