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:
5
task.go
5
task.go
@@ -65,8 +65,9 @@ func (e *Executor) Run(ctx context.Context, calls ...taskfile.Call) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if e.Summary {
|
if e.Summary {
|
||||||
firstTask := calls[0].Task
|
for _, call := range calls {
|
||||||
summary.Print(e.Logger, e.Taskfile.Tasks[firstTask])
|
summary.Print(e.Logger, e.Taskfile.Tasks[call.Task])
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -574,7 +574,7 @@ func TestSummary(t *testing.T) {
|
|||||||
const secondTask = "task-with-summary"
|
const secondTask = "task-with-summary"
|
||||||
assert.NoError(t, e.Run(context.Background(), taskfile.Call{Task: firstTask}, taskfile.Call{Task: secondTask}))
|
assert.NoError(t, e.Run(context.Background(), taskfile.Call{Task: firstTask}, taskfile.Call{Task: secondTask}))
|
||||||
assert.Contains(t, buff.String(), "summary of "+firstTask)
|
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 {
|
func readTestFixture(t *testing.T, dir string, file string) string {
|
||||||
|
|||||||
Reference in New Issue
Block a user