mirror of
				https://github.com/go-task/task.git
				synced 2025-10-30 23:58:01 +02:00 
			
		
		
		
	fix: list tasks (#1520)
This commit is contained in:
		| @@ -264,10 +264,6 @@ func run() error { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	if (listOptions.ShouldListTasks()) && flags.silent { | ||||
| 		return e.ListTaskNames(flags.listAll) | ||||
| 	} | ||||
|  | ||||
| 	if err := e.Setup(); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| @@ -278,6 +274,10 @@ func run() error { | ||||
| 		return nil | ||||
| 	} | ||||
|  | ||||
| 	if (listOptions.ShouldListTasks()) && flags.silent { | ||||
| 		return e.ListTaskNames(flags.listAll) | ||||
| 	} | ||||
|  | ||||
| 	if listOptions.ShouldListTasks() { | ||||
| 		foundTasks, err := e.ListTasks(listOptions) | ||||
| 		if err != nil { | ||||
|   | ||||
							
								
								
									
										10
									
								
								help.go
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								help.go
									
									
									
									
									
								
							| @@ -121,16 +121,6 @@ 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) error { | ||||
| 	// 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 { | ||||
| 			return err | ||||
| 		} | ||||
| 	} | ||||
| 	// use stdout if no output defined | ||||
| 	var w io.Writer = os.Stdout | ||||
| 	if e.Stdout != nil { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user