summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/rebar_prv_local_install.erl4
-rw-r--r--src/rebar_prv_local_upgrade.erl2
-rw-r--r--src/rebar_prv_shell.erl9
-rw-r--r--src/rebar_utils.erl13
4 files changed, 18 insertions, 10 deletions
diff --git a/src/rebar_prv_local_install.erl b/src/rebar_prv_local_install.erl
index 65468a3..1b58859 100644
--- a/src/rebar_prv_local_install.erl
+++ b/src/rebar_prv_local_install.erl
@@ -15,7 +15,7 @@
-include_lib("kernel/include/file.hrl").
-define(PROVIDER, install).
--define(NAMESPACE, unstable).
+-define(NAMESPACE, local).
-define(DEPS, []).
%% ===================================================================
@@ -60,7 +60,7 @@ format_error(Reason) ->
bin_contents(OutputDir) ->
<<"#!/usr/bin/env sh
-erl -pz ", (ec_cnv:to_binary(OutputDir))/binary,"/*/ebin +sbtu +A0 -noshell -boot start_clean -s rebar3 main -extra \"$@\"
+erl -pz ", (ec_cnv:to_binary(OutputDir))/binary,"/*/ebin +sbtu +A0 -noshell -boot start_clean -s rebar3 main $REBAR3_ERL_ARGS -extra \"$@\"
">>.
extract_escript(State, ScriptPath) ->
diff --git a/src/rebar_prv_local_upgrade.erl b/src/rebar_prv_local_upgrade.erl
index bdfc232..aa9ee44 100644
--- a/src/rebar_prv_local_upgrade.erl
+++ b/src/rebar_prv_local_upgrade.erl
@@ -14,7 +14,7 @@
-include_lib("kernel/include/file.hrl").
-define(PROVIDER, upgrade).
--define(NAMESPACE, unstable).
+-define(NAMESPACE, local).
-define(DEPS, []).
%% ===================================================================
diff --git a/src/rebar_prv_shell.erl b/src/rebar_prv_shell.erl
index 824293f..ea759fc 100644
--- a/src/rebar_prv_shell.erl
+++ b/src/rebar_prv_shell.erl
@@ -325,9 +325,14 @@ reread_config(State) ->
no_config ->
ok;
ConfigList ->
- _ = [application:set_env(Application, Key, Val)
+ try
+ [application:set_env(Application, Key, Val)
|| {Application, Items} <- ConfigList,
- {Key, Val} <- Items],
+ {Key, Val} <- Items]
+ catch _:_ ->
+ ?ERROR("The configuration file submitted could not be read "
+ "and will be ignored.", [])
+ end,
ok
end.
diff --git a/src/rebar_utils.erl b/src/rebar_utils.erl
index 746c57a..07bf789 100644
--- a/src/rebar_utils.erl
+++ b/src/rebar_utils.erl
@@ -828,8 +828,11 @@ info_useless(Old, New) ->
not lists:member(Name, New)],
ok.
--ifdef(no_list_dir_all).
-list_dir(Dir) -> file:list_dir(Dir).
--else.
-list_dir(Dir) -> file:list_dir_all(Dir).
--endif.
+list_dir(Dir) ->
+ %% `list_dir_all` returns raw files which are unsupported
+ %% prior to R16 so just fall back to `list_dir` if running
+ %% on an earlier vm
+ case erlang:function_exported(file, list_dir_all, 1) of
+ true -> file:list_dir_all(Dir);
+ false -> file:list_dir(Dir)
+ end.