mirror of
				https://github.com/go-task/task.git
				synced 2025-10-30 23:58:01 +02:00 
			
		
		
		
	Running deps first
This commit is contained in:
		
							
								
								
									
										14
									
								
								task.go
									
									
									
									
									
								
							
							
						
						
									
										14
									
								
								task.go
									
									
									
									
									
								
							| @@ -2,6 +2,7 @@ package task | |||||||
|  |  | ||||||
| import ( | import ( | ||||||
| 	"encoding/json" | 	"encoding/json" | ||||||
|  | 	"fmt" | ||||||
| 	"io/ioutil" | 	"io/ioutil" | ||||||
| 	"log" | 	"log" | ||||||
| 	"os" | 	"os" | ||||||
| @@ -83,21 +84,22 @@ func RunTask(name string) error { | |||||||
| 		return &taskNotFoundError{name} | 		return &taskNotFoundError{name} | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	if !Force && isTaskUpToDate(t) { |  | ||||||
| 		log.Printf(`task: Task "%s" is up to date`, name) |  | ||||||
| 		return nil |  | ||||||
| 	} |  | ||||||
| 	vars, err := t.handleVariables() | 	vars, err := t.handleVariables() | ||||||
| 	if err != nil { | 	if err != nil { | ||||||
| 		return &taskRunError{name, err} | 		return &taskRunError{name, err} | ||||||
| 	} | 	} | ||||||
|    |  | ||||||
| 	for _, d := range t.Deps { | 	for _, d := range t.Deps { | ||||||
| 		if err := RunTask(ReplaceVariables(d, vars)); err != nil { | 		if err := RunTask(ReplaceVariables(d, vars)); err != nil { | ||||||
| 			return err | 			return err | ||||||
| 		} | 		} | ||||||
| 	} | 	} | ||||||
|    |  | ||||||
|  | 	if !Force && isTaskUpToDate(t) { | ||||||
|  | 		log.Printf(`task: Task "%s" is up to date`, name) | ||||||
|  | 		return nil | ||||||
|  | 	} | ||||||
|  |  | ||||||
| 	for _, c := range t.Cmds { | 	for _, c := range t.Cmds { | ||||||
| 		// read in a each time, as a command could change a variable or it has been changed by a dependency | 		// read in a each time, as a command could change a variable or it has been changed by a dependency | ||||||
| 		vars, err = t.handleVariables() | 		vars, err = t.handleVariables() | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user