瀏覽代碼

'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 10 年之前
父節點
當前提交
2fabfe1ee8
共有 1 個檔案被更改,包括 4 行新增0 行删除
  1. +4
    -0
      src/rebar_prv_do.erl

+ 4
- 0
src/rebar_prv_do.erl 查看文件

@ -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} ->

Loading…
取消
儲存