summaryrefslogtreecommitdiff
path: root/src/rebar_utils.erl
diff options
context:
space:
mode:
authorTristan Sloughter <tristan.sloughter@gmail.com>2015-06-27 17:47:56 -0500
committerTristan Sloughter <tristan.sloughter@gmail.com>2015-06-27 17:47:56 -0500
commit5012e06e68a168d102545ddd3fb0428715c08753 (patch)
tree1d84b4e90a580be07e632fa4a468ec82d4055adb /src/rebar_utils.erl
parente28ebaa95725698bfed110804e0448c073c98531 (diff)
parent99858f3b6902c4feb95620ce0125c52635bf8f00 (diff)
Merge pull request #489 from kovyl2404/windows-ct-fix
Make test on windows green.
Diffstat (limited to 'src/rebar_utils.erl')
-rw-r--r--src/rebar_utils.erl14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/rebar_utils.erl b/src/rebar_utils.erl
index cc59ed0..0cbc7c2 100644
--- a/src/rebar_utils.erl
+++ b/src/rebar_utils.erl
@@ -154,7 +154,7 @@ sh(Command0, Options0) ->
Command = lists:flatten(patch_on_windows(Command0, proplists:get_value(env, Options, []))),
PortSettings = proplists:get_all_values(port_settings, Options) ++
- [exit_status, {line, 16384}, use_stdio, stderr_to_stdout, hide],
+ [exit_status, {line, 16384}, use_stdio, stderr_to_stdout, hide, eof],
?DEBUG("Port Cmd: ~s\nPort Opts: ~p\n", [Command, PortSettings]),
Port = open_port({spawn, Command}, PortSettings),
@@ -435,10 +435,14 @@ sh_loop(Port, Fun, Acc) ->
sh_loop(Port, Fun, Fun(Line ++ "\n", Acc));
{Port, {data, {noeol, Line}}} ->
sh_loop(Port, Fun, Fun(Line, Acc));
- {Port, {exit_status, 0}} ->
- {ok, lists:flatten(lists:reverse(Acc))};
- {Port, {exit_status, Rc}} ->
- {error, {Rc, lists:flatten(lists:reverse(Acc))}}
+ {Port, eof} ->
+ Data = lists:flatten(lists:reverse(Acc)),
+ receive
+ {Port, {exit_status, 0}} ->
+ {ok, Data};
+ {Port, {exit_status, Rc}} ->
+ {error, {Rc, Data}}
+ end
end.
beam_to_mod(Dir, Filename) ->