1
0
mirror of https://github.com/go-task/task.git synced 2025-11-27 22:38:20 +02:00

display summary for tasks without summary/description

This commit is contained in:
jaedle
2019-02-24 19:02:44 +01:00
parent 3f8ee21849
commit 3ca590b185
6 changed files with 22 additions and 61 deletions

12
task.go
View File

@@ -66,7 +66,7 @@ func (e *Executor) Run(ctx context.Context, calls ...taskfile.Call) error {
if e.Summary {
firstTask := calls[0].Task
e.printTaskSummary(firstTask)
summary.Print(e.Logger, e.Taskfile.Tasks[firstTask])
return nil
}
@@ -82,16 +82,6 @@ func (e *Executor) Run(ctx context.Context, calls ...taskfile.Call) error {
return nil
}
func (e *Executor) printTaskSummary(task string) {
t := e.Taskfile.Tasks[task]
if t.Summary == "" {
e.Logger.Errf("task: There is no summary for task: %s", task)
return
}
summary.Print(e.Logger, t)
}
// Setup setups Executor's internal state
func (e *Executor) Setup() error {
var err error