From 4b3cea3812b0e2624c5d6f506d5f22607ce51701 Mon Sep 17 00:00:00 2001 From: jaedle Date: Sun, 24 Feb 2019 14:53:39 +0100 Subject: [PATCH] display dependend tasks --- task.go | 7 +++++++ testdata/details/Taskfile.yml | 10 +++++++--- .../task-with-description-containing-empty-line.txt | 2 ++ testdata/details/task-with-details.txt | 4 ++++ 4 files changed, 20 insertions(+), 3 deletions(-) diff --git a/task.go b/task.go index 8936f462..e1e2ca4c 100644 --- a/task.go +++ b/task.go @@ -95,6 +95,13 @@ func (e *Executor) printTaskDetails(task string) { Logger := e.Logger displayTaskDetailedDescription(s, Logger) + e.Logger.Outf("") + e.Logger.Outf("dependencies:") + + for _, d := range t.Deps { + e.Logger.Outf(" - %s", d.Task) + } + e.Logger.Outf("") e.Logger.Outf("commands:") diff --git a/testdata/details/Taskfile.yml b/testdata/details/Taskfile.yml index e5e3b0e2..fae4579b 100644 --- a/testdata/details/Taskfile.yml +++ b/testdata/details/Taskfile.yml @@ -1,7 +1,7 @@ version: 2 tasks: task-with-details: - deps: [dependend-task] + deps: [dependend-task-1,dependend-task-2] details: | details of task-with-details - line 1 line 2 @@ -16,9 +16,13 @@ tasks: cmds: - echo 'task-without-details was executed' - dependend-task: + dependend-task-1: cmds: - - echo 'dependend-task was executed' + - echo 'dependend-task-1 was executed' + - + dependend-task-2: + cmds: + - echo 'dependend-task-2 was executed' other-task-with-details: details: details of other-task-with-details diff --git a/testdata/details/task-with-description-containing-empty-line.txt b/testdata/details/task-with-description-containing-empty-line.txt index 6915ebe7..f47ff01e 100644 --- a/testdata/details/task-with-description-containing-empty-line.txt +++ b/testdata/details/task-with-description-containing-empty-line.txt @@ -4,5 +4,7 @@ First line followed by empty line Last Line +dependencies: + commands: - exit 0 diff --git a/testdata/details/task-with-details.txt b/testdata/details/task-with-details.txt index 9e327a50..437d85cb 100644 --- a/testdata/details/task-with-details.txt +++ b/testdata/details/task-with-details.txt @@ -4,6 +4,10 @@ details of task-with-details - line 1 line 2 line 3 +dependencies: + - dependend-task-1 + - dependend-task-2 + commands: - echo 'task-with-details was executed' - echo 'another command'