summaryrefslogtreecommitdiff
path: root/src/rebar_utils.erl
diff options
context:
space:
mode:
Diffstat (limited to 'src/rebar_utils.erl')
-rw-r--r--src/rebar_utils.erl11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/rebar_utils.erl b/src/rebar_utils.erl
index 1a7bf98..5bb0e63 100644
--- a/src/rebar_utils.erl
+++ b/src/rebar_utils.erl
@@ -308,6 +308,9 @@ expand_sh_flag(abort_on_error) ->
expand_sh_flag({abort_on_error, Message}) ->
{error_handler,
log_msg_and_abort(Message)};
+expand_sh_flag({debug_abort_on_error, Message}) ->
+ {error_handler,
+ debug_log_msg_and_abort(Message)};
expand_sh_flag(debug_and_abort_on_error) ->
{error_handler,
fun debug_and_abort/2};
@@ -335,6 +338,14 @@ log_msg_and_abort(Message) ->
?ABORT(Message, [])
end.
+debug_log_msg_and_abort(Message) ->
+ fun(Command, {Rc, Output}) ->
+ ?DEBUG("sh(~s)~n"
+ "failed with return code ~w and the following output:~n"
+ "~s", [Command, Rc, Output]),
+ ?ABORT(Message, [])
+ end.
+
-spec log_and_abort(string(), {integer(), string()}) -> no_return().
log_and_abort(Command, {Rc, Output}) ->
?ABORT("sh(~s)~n"