mirror of
https://github.com/go-task/task.git
synced 2025-04-11 11:41:56 +02:00
fix: setup logger if nil when listing task names
This commit is contained in:
parent
e2b0789b0c
commit
ba81181eb7
4
help.go
4
help.go
@ -122,6 +122,10 @@ func (e *Executor) ListTasks(o ListOptions) (bool, error) {
|
||||
// Only tasks with a non-empty description are printed if allTasks is false.
|
||||
// Otherwise, all task names are printed.
|
||||
func (e *Executor) ListTaskNames(allTasks bool) {
|
||||
// if called from cmd/task.go, e.Logger has not yet been initialized
|
||||
if e.Logger == nil {
|
||||
e.setupLogger()
|
||||
}
|
||||
// if called from cmd/task.go, e.Taskfile has not yet been parsed
|
||||
if e.Taskfile == nil {
|
||||
if err := e.readTaskfile(); err != nil {
|
||||
|
Loading…
x
Reference in New Issue
Block a user