1
0
mirror of https://github.com/go-task/task.git synced 2025-04-27 12:32:25 +02:00

Running deps first

This commit is contained in:
Sascha Andres 2017-03-05 10:15:49 +01:00
parent d8f9b0697d
commit 561c213a92

10
task.go
View File

@ -2,6 +2,7 @@ package task
import ( import (
"encoding/json" "encoding/json"
"fmt"
"io/ioutil" "io/ioutil"
"log" "log"
"os" "os"
@ -83,10 +84,6 @@ 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}
@ -98,6 +95,11 @@ func RunTask(name string) error {
} }
} }
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()