From 93bfd578563429b87e5e0dc19744c9fd5ebb2861 Mon Sep 17 00:00:00 2001 From: jaedle Date: Mon, 4 Mar 2019 12:09:58 +0100 Subject: [PATCH] print summary for multiple tasks --- task.go | 5 +++-- task_test.go | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/task.go b/task.go index 2cc84cd7..798c6bfe 100644 --- a/task.go +++ b/task.go @@ -65,8 +65,9 @@ func (e *Executor) Run(ctx context.Context, calls ...taskfile.Call) error { } if e.Summary { - firstTask := calls[0].Task - summary.Print(e.Logger, e.Taskfile.Tasks[firstTask]) + for _, call := range calls { + summary.Print(e.Logger, e.Taskfile.Tasks[call.Task]) + } return nil } diff --git a/task_test.go b/task_test.go index 392c40a8..4aa6db0d 100644 --- a/task_test.go +++ b/task_test.go @@ -574,7 +574,7 @@ func TestSummary(t *testing.T) { const secondTask = "task-with-summary" assert.NoError(t, e.Run(context.Background(), taskfile.Call{Task: firstTask}, taskfile.Call{Task: secondTask})) assert.Contains(t, buff.String(), "summary of "+firstTask) - assert.NotContains(t, buff.String(), "summary of "+secondTask) + assert.Contains(t, buff.String(), "summary of "+secondTask) } func readTestFixture(t *testing.T, dir string, file string) string {