1
0
mirror of https://github.com/go-task/task.git synced 2025-01-26 05:27:15 +02:00

refactoring

This commit is contained in:
jaedle 2019-03-04 12:28:11 +01:00
parent f66edbad50
commit 8eadfc1bf6

View File

@ -81,17 +81,19 @@ func printTaskDependencies(l *logger.Logger, t *taskfile.Task) {
}
func printTaskCommands(l *logger.Logger, t *taskfile.Task) {
hasCommands := len(t.Cmds) > 0
if hasCommands {
l.Outf("")
l.Outf("commands:")
for _, c := range t.Cmds {
isCommand := c.Cmd != ""
if isCommand {
l.Outf(" - %s", c.Cmd)
} else {
l.Outf(" - Task: %s", c.Task)
}
noCommands := len(t.Cmds) == 0
if noCommands {
return
}
l.Outf("")
l.Outf("commands:")
for _, c := range t.Cmds {
isCommand := c.Cmd != ""
if isCommand {
l.Outf(" - %s", c.Cmd)
} else {
l.Outf(" - Task: %s", c.Task)
}
}
}