mirror of
https://github.com/go-task/task.git
synced 2025-01-12 04:34:11 +02:00
print task in command section
This commit is contained in:
parent
a4a20d92a4
commit
c82a7240bb
@ -24,7 +24,11 @@ func printTaskCommands(cmds []*taskfile.Cmd, logger *logger.Logger) {
|
||||
logger.Outf("")
|
||||
logger.Outf("commands:")
|
||||
for _, c := range cmds {
|
||||
logger.Outf(" - %s", c.Cmd)
|
||||
if c.Cmd != "" {
|
||||
logger.Outf(" - %s", c.Cmd)
|
||||
} else {
|
||||
logger.Outf(" - Task: %s", c.Task)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -75,7 +75,7 @@ func TestPrintTaskCommandsIfPresent(t *testing.T) {
|
||||
Cmds: []*taskfile.Cmd{
|
||||
{Cmd: "command-1"},
|
||||
{Cmd: "command-2"},
|
||||
{Cmd: "command-3"},
|
||||
{Task: "task-1"},
|
||||
},
|
||||
}
|
||||
|
||||
@ -84,7 +84,7 @@ func TestPrintTaskCommandsIfPresent(t *testing.T) {
|
||||
assert.Contains(t, buffer.String(), "\ncommands:\n")
|
||||
assert.Contains(t, buffer.String(), "\n - command-1\n")
|
||||
assert.Contains(t, buffer.String(), "\n - command-2\n")
|
||||
assert.Contains(t, buffer.String(), "\n - command-3\n")
|
||||
assert.Contains(t, buffer.String(), "\n - Task: task-1\n")
|
||||
}
|
||||
|
||||
func TestDoesNotPrintCommandIfMissing(t *testing.T) {
|
||||
|
Loading…
Reference in New Issue
Block a user