Browse Source

Merge pull request #177 from tsloughter/hook_output

output hook stdout and don't add extra newline
pull/178/head
Fred Hebert 10 years ago
parent
commit
f726800a05
2 changed files with 3 additions and 2 deletions
  1. +1
    -1
      src/rebar_hooks.erl
  2. +2
    -1
      src/rebar_utils.erl

+ 1
- 1
src/rebar_hooks.erl View File

@ -22,4 +22,4 @@ apply_hook(Dir, Env, {Arch, Command, Hook}) ->
end; end;
apply_hook(Dir, Env, {Command, Hook}) -> apply_hook(Dir, Env, {Command, Hook}) ->
Msg = lists:flatten(io_lib:format("Hook for ~p failed!~n", [Command])), Msg = lists:flatten(io_lib:format("Hook for ~p failed!~n", [Command])),
rebar_utils:sh(Hook, [{cd, Dir}, {env, Env}, {abort_on_error, Msg}]).
rebar_utils:sh(Hook, [use_stdout, {cd, Dir}, {env, Env}, {abort_on_error, Msg}]).

+ 2
- 1
src/rebar_utils.erl View File

@ -314,7 +314,8 @@ expand_sh_flag(debug_and_abort_on_error) ->
expand_sh_flag(use_stdout) -> expand_sh_flag(use_stdout) ->
{output_handler, {output_handler,
fun(Line, Acc) -> fun(Line, Acc) ->
?CONSOLE("~s", [Line]),
%% Line already has a newline so don't use ?CONSOLE which adds one
io:format("~s", [Line]),
[Line | Acc] [Line | Acc]
end}; end};
expand_sh_flag({use_stdout, false}) -> expand_sh_flag({use_stdout, false}) ->

Loading…
Cancel
Save