1
0
mirror of https://github.com/go-task/task.git synced 2025-03-19 21:17:46 +02:00

display commands of task

This commit is contained in:
jaedle 2019-02-24 14:37:14 +01:00
parent db1d3183b6
commit 0446cfdba0
4 changed files with 12 additions and 1 deletions

View File

@ -82,7 +82,8 @@ func (e *Executor) Run(ctx context.Context, calls ...taskfile.Call) error {
}
func (e *Executor) printTaskDetails(task string) {
s := e.Taskfile.Tasks[task].Details
t := e.Taskfile.Tasks[task]
s := t.Details
if s == "" {
e.Logger.Errf("task: There is no detailed description for task: %s", task)
return
@ -96,6 +97,10 @@ func (e *Executor) printTaskDetails(task string) {
e.Logger.Outf("")
e.Logger.Outf("commands:")
for _, c := range t.Cmds {
e.Logger.Outf(" - %s", c.Cmd)
}
}
func displayTaskDetailedDescription(description string, Logger *logger.Logger) {

View File

@ -8,6 +8,8 @@ tasks:
line 3
cmds:
- echo 'task-with-details was executed'
- echo 'another command'
- exit 0
task-without-details:
deps: [dependend-task]

View File

@ -5,3 +5,4 @@ First line followed by empty line
Last Line
commands:
- exit 0

View File

@ -5,3 +5,6 @@ line 2
line 3
commands:
- echo 'task-with-details was executed'
- echo 'another command'
- exit 0