Can the output task name mention the parent?

In the output is there a way to highlight the task name that triggered the current cmds? In this taskfile:
tasks:
build-server:
- task: install-deb
vars: ...

install-deb:
- apt instal ...
tasks:
build-server:
- task: install-deb
vars: ...

install-deb:
- apt instal ...
The output of task build-server would be:
[install-deb] apt install ...
[install-deb] apt install ...
With no mention of build-server. Is it possible to configure task to output [build-server > install-deb]?
1 Reply
Mihai Stancu
Mihai StancuOP5w ago
Right now my workaround is:
tasks:
build-server:
vars: {PARENT: '{{.TASK}}'}
cmds:
- task: install-deb
vars: ...

install-deb:
label: '{{if .PARENT}}{{.PARENT}} >{{end}}{{.TASK}}'
cmds:
- apt instal ...
tasks:
build-server:
vars: {PARENT: '{{.TASK}}'}
cmds:
- task: install-deb
vars: ...

install-deb:
label: '{{if .PARENT}}{{.PARENT}} >{{end}}{{.TASK}}'
cmds:
- apt instal ...

Did you find this page helpful?