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