1
0
mirror of https://github.com/go-task/task.git synced 2025-11-25 22:32:55 +02:00

print summary for multiple tasks

This commit is contained in:
jaedle
2019-03-04 12:09:58 +01:00
parent 7e7e1bccba
commit 93bfd57856
2 changed files with 4 additions and 3 deletions

View File

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

View File

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