From fdbc130d8d70e5069d4f10776bb4d55c7d6d581d Mon Sep 17 00:00:00 2001 From: jaedle Date: Sun, 24 Feb 2019 14:55:04 +0100 Subject: [PATCH] do not show empty dependencies --- task.go | 10 ++++++---- .../task-with-description-containing-empty-line.txt | 2 -- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/task.go b/task.go index e1e2ca4c..be51a21d 100644 --- a/task.go +++ b/task.go @@ -95,11 +95,13 @@ func (e *Executor) printTaskDetails(task string) { Logger := e.Logger displayTaskDetailedDescription(s, Logger) - e.Logger.Outf("") - e.Logger.Outf("dependencies:") + if len(t.Deps) > 0 { + e.Logger.Outf("") + e.Logger.Outf("dependencies:") - for _, d := range t.Deps { - e.Logger.Outf(" - %s", d.Task) + for _, d := range t.Deps { + e.Logger.Outf(" - %s", d.Task) + } } e.Logger.Outf("") diff --git a/testdata/details/task-with-description-containing-empty-line.txt b/testdata/details/task-with-description-containing-empty-line.txt index f47ff01e..6915ebe7 100644 --- a/testdata/details/task-with-description-containing-empty-line.txt +++ b/testdata/details/task-with-description-containing-empty-line.txt @@ -4,7 +4,5 @@ First line followed by empty line Last Line -dependencies: - commands: - exit 0