1
0
mirror of https://github.com/go-task/task.git synced 2025-11-23 22:24:45 +02:00

print commands on summary only if commands are present

This commit is contained in:
jaedle
2019-02-24 16:08:32 +01:00
parent 31ecf167cc
commit 4dcb124693
3 changed files with 16 additions and 18 deletions

11
task.go
View File

@@ -98,9 +98,13 @@ func (e *Executor) printTaskSummary(task string) {
}
func printCommands(cmds []*taskfile.Cmd, logger *logger.Logger) {
logger.Outf("commands:")
for _, c := range cmds {
logger.Outf(" - %s", c.Cmd)
hasCommands := len(cmds) > 0
if hasCommands {
logger.Outf("")
logger.Outf("commands:")
for _, c := range cmds {
logger.Outf(" - %s", c.Cmd)
}
}
}
@@ -114,7 +118,6 @@ func printTaskDependencies(deps []*taskfile.Dep, logger *logger.Logger) {
logger.Outf(" - %s", d.Task)
}
}
logger.Outf("")
}
func printTaskSummary(description string, Logger *logger.Logger) {