1
0
mirror of https://github.com/go-task/task.git synced 2025-11-25 22:32:55 +02:00

Always expode .TIMESTAMP and .STATUS when using status:

This commit is contained in:
Andrey Nering
2019-09-14 18:04:41 -03:00
parent 1a28e5e0d4
commit 14d7f04a81
4 changed files with 48 additions and 66 deletions

View File

@@ -5,6 +5,7 @@ import (
"strings"
"github.com/go-task/task/v2/internal/execext"
"github.com/go-task/task/v2/internal/status"
"github.com/go-task/task/v2/internal/taskfile"
"github.com/go-task/task/v2/internal/templater"
)
@@ -96,17 +97,14 @@ func (e *Executor) CompiledTask(call taskfile.Call) (*taskfile.Task, error) {
}
if len(origTask.Status) > 0 {
checker, err := e.getStatusChecker(&new)
if err != nil {
return nil, err
for _, checker := range []status.Checker{e.timestampChecker(&new), e.checksumChecker(&new)} {
value, err := checker.Value()
if err != nil {
return nil, err
}
vars[strings.ToUpper(checker.Kind())] = taskfile.Var{Live: value}
}
value, err := checker.Value()
if err != nil {
return nil, err
}
vars[strings.ToUpper(checker.Kind())] = taskfile.Var{Live: value}
// Adding new variables, requires us to refresh the templaters
// cache of the the values manually
r.ResetCache()