mirror of
https://github.com/go-task/task.git
synced 2025-11-23 22:24:45 +02:00
func isUpToDate should be bound to Task struct
This commit is contained in:
@@ -228,7 +228,7 @@ func (e *Executor) handleDynamicVariableContent(v Var) (string, error) {
|
||||
|
||||
// CompiledTask returns a copy of a task, but replacing
|
||||
// variables in almost all properties using the Go template package
|
||||
func (t *Task) CompiledTask(vars Vars) (*Task, error) {
|
||||
func (t *Task) CompiledTask(dir string, vars Vars) (*Task, error) {
|
||||
r := varReplacer{vars: vars}
|
||||
|
||||
new := Task{
|
||||
@@ -242,6 +242,9 @@ func (t *Task) CompiledTask(vars Vars) (*Task, error) {
|
||||
Env: r.replaceVars(t.Env),
|
||||
Silent: t.Silent,
|
||||
}
|
||||
if dir != "" && !filepath.IsAbs(new.Dir) {
|
||||
new.Dir = filepath.Join(dir, new.Dir)
|
||||
}
|
||||
|
||||
if len(t.Cmds) > 0 {
|
||||
new.Cmds = make([]*Cmd, len(t.Cmds))
|
||||
|
||||
Reference in New Issue
Block a user