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:
parent
db1d3183b6
commit
0446cfdba0
7
task.go
7
task.go
@ -82,7 +82,8 @@ func (e *Executor) Run(ctx context.Context, calls ...taskfile.Call) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (e *Executor) printTaskDetails(task string) {
|
func (e *Executor) printTaskDetails(task string) {
|
||||||
s := e.Taskfile.Tasks[task].Details
|
t := e.Taskfile.Tasks[task]
|
||||||
|
s := t.Details
|
||||||
if s == "" {
|
if s == "" {
|
||||||
e.Logger.Errf("task: There is no detailed description for task: %s", task)
|
e.Logger.Errf("task: There is no detailed description for task: %s", task)
|
||||||
return
|
return
|
||||||
@ -96,6 +97,10 @@ func (e *Executor) printTaskDetails(task string) {
|
|||||||
|
|
||||||
e.Logger.Outf("")
|
e.Logger.Outf("")
|
||||||
e.Logger.Outf("commands:")
|
e.Logger.Outf("commands:")
|
||||||
|
|
||||||
|
for _, c := range t.Cmds {
|
||||||
|
e.Logger.Outf(" - %s", c.Cmd)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func displayTaskDetailedDescription(description string, Logger *logger.Logger) {
|
func displayTaskDetailedDescription(description string, Logger *logger.Logger) {
|
||||||
|
2
testdata/details/Taskfile.yml
vendored
2
testdata/details/Taskfile.yml
vendored
@ -8,6 +8,8 @@ tasks:
|
|||||||
line 3
|
line 3
|
||||||
cmds:
|
cmds:
|
||||||
- echo 'task-with-details was executed'
|
- echo 'task-with-details was executed'
|
||||||
|
- echo 'another command'
|
||||||
|
- exit 0
|
||||||
|
|
||||||
task-without-details:
|
task-without-details:
|
||||||
deps: [dependend-task]
|
deps: [dependend-task]
|
||||||
|
@ -5,3 +5,4 @@ First line followed by empty line
|
|||||||
Last Line
|
Last Line
|
||||||
|
|
||||||
commands:
|
commands:
|
||||||
|
- exit 0
|
||||||
|
@ -5,3 +5,6 @@ line 2
|
|||||||
line 3
|
line 3
|
||||||
|
|
||||||
commands:
|
commands:
|
||||||
|
- echo 'task-with-details was executed'
|
||||||
|
- echo 'another command'
|
||||||
|
- exit 0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user