1
0
mirror of https://github.com/go-task/task.git synced 2025-06-23 00:38:19 +02:00

Add Taskfile struct and start implementing new format

Updates #54, #66 and #77
This commit is contained in:
Andrey Nering
2017-12-29 18:27:32 -02:00
parent 00ff1447ee
commit 134c6b79c4
8 changed files with 93 additions and 24 deletions

View File

@ -92,7 +92,7 @@ func (v *Var) UnmarshalYAML(unmarshal func(interface{}) error) error {
// 4. Taskvars variables, resolved with access to:
// - environment variables
func (e *Executor) getVariables(call Call) (Vars, error) {
t, ok := e.Tasks[call.Task]
t, ok := e.Taskfile.Tasks[call.Task]
if !ok {
return nil, &taskNotFoundError{call.Task}
}
@ -198,7 +198,7 @@ func (e *Executor) handleShVar(v Var) (string, error) {
// CompiledTask returns a copy of a task, but replacing variables in almost all
// properties using the Go template package.
func (e *Executor) CompiledTask(call Call) (*Task, error) {
origTask, ok := e.Tasks[call.Task]
origTask, ok := e.Taskfile.Tasks[call.Task]
if !ok {
return nil, &taskNotFoundError{call.Task}
}