mirror of
https://github.com/go-task/task.git
synced 2025-06-15 00:15:10 +02:00
Add Taskfile struct and start implementing new format
Updates #54, #66 and #77
This commit is contained in:
18
task.go
18
task.go
@ -23,12 +23,12 @@ const (
|
||||
|
||||
// Executor executes a Taskfile
|
||||
type Executor struct {
|
||||
Tasks Tasks
|
||||
Dir string
|
||||
Force bool
|
||||
Watch bool
|
||||
Verbose bool
|
||||
Silent bool
|
||||
Taskfile *Taskfile
|
||||
Dir string
|
||||
Force bool
|
||||
Watch bool
|
||||
Verbose bool
|
||||
Silent bool
|
||||
|
||||
Context context.Context
|
||||
|
||||
@ -78,8 +78,8 @@ func (e *Executor) Run(calls ...Call) error {
|
||||
e.Stderr = os.Stderr
|
||||
}
|
||||
|
||||
e.taskCallCount = make(map[string]*int32, len(e.Tasks))
|
||||
for k := range e.Tasks {
|
||||
e.taskCallCount = make(map[string]*int32, len(e.Taskfile.Tasks))
|
||||
for k := range e.Taskfile.Tasks {
|
||||
e.taskCallCount[k] = new(int32)
|
||||
}
|
||||
|
||||
@ -89,7 +89,7 @@ func (e *Executor) Run(calls ...Call) error {
|
||||
|
||||
// check if given tasks exist
|
||||
for _, c := range calls {
|
||||
if _, ok := e.Tasks[c.Task]; !ok {
|
||||
if _, ok := e.Taskfile.Tasks[c.Task]; !ok {
|
||||
// FIXME: move to the main package
|
||||
e.PrintTasksHelp()
|
||||
return &taskNotFoundError{taskName: c.Task}
|
||||
|
Reference in New Issue
Block a user