Procházet zdrojové kódy

'do' returns its final state.

While 'do' skips state updates between subcommands so that:

    rebar3 do a, b  == (rebar3 a && rebar3 b)

The final state of 'b' does not need to be discarded and might in fact
be useful to get when dealing with Rebar3 as an API.

This can be done without breaking the equality relation already
established.
pull/473/head
Fred Hebert před 10 roky
rodič
revize
2fabfe1ee8
1 změnil soubory, kde provedl 4 přidání a 0 odebrání
  1. +4
    -0
      src/rebar_prv_do.erl

+ 4
- 0
src/rebar_prv_do.erl Zobrazit soubor

@ -47,6 +47,8 @@ do_tasks([{TaskStr, Args}|Tail], State) ->
default ->
%% The first task we hit might be a namespace!
case maybe_namespace(State2, Task, Args) of
{ok, FinalState} when Tail =:= [] ->
{ok, FinalState};
{ok, _} ->
do_tasks(Tail, State);
{error, Reason} ->
@ -56,6 +58,8 @@ do_tasks([{TaskStr, Args}|Tail], State) ->
%% We're already in a non-default namespace, check the
%% task directly.
case rebar_core:process_command(State2, Task) of
{ok, FinalState} when Tail =:= [] ->
{ok, FinalState};
{ok, _} ->
do_tasks(Tail, State);
{error, Reason} ->

Načítá se…
Zrušit
Uložit