anchor.diff:          nomatch ->
              match_first(Rest, Val)
       end.
  +
  +sh_loop(Port) ->            
  +    receive
  +        {Port, {data, {_, Line}}} ->
  +            ?INFO("> ~s\n", [Line]),
  +            sh_loop(Port);
  +        {Port, {exit_status, 0}} ->
  +            ok;
  +        {Port, {exit_status, Rc}} ->
  +            {error, Rc}
  +    end.
  
positive.code: -module(rebar_utils).
  
  -export([get_cwd/0,
           get_os/0]).
  
  
  %% ====================================================================
  %% Public API
  
negative.code:             {unknown, Arch};
          ArchAtom ->
              ArchAtom
      end.
  
  
  sh(Command, Env) ->
      ?INFO("sh: ~s\n~p\n", [Command, Env]),
      Port = open_port({spawn, Command}, [{env, Env}, exit_status, {line, 16384},
                                          use_stdio, stderr_to_stdout]),
      sh_loop(Port).
  
  sh_failfast(Command, Env) ->
      case sh(Command, Env) of
          ok ->
              ok;
          {error, Rc} ->
              ?ERROR("~s failed with error: ~w\n", [Command, Rc]),
              ?FAIL
      end.
  
  
  