mirror of
https://github.com/go-task/task.git
synced 2026-06-29 15:44:30 +00:00
Abstract Tasks type
This commit is contained in:
@@ -8,7 +8,7 @@ import (
|
||||
|
||||
func TestCyclicDepCheck(t *testing.T) {
|
||||
isCyclic := &task.Executor{
|
||||
Tasks: map[string]*task.Task{
|
||||
Tasks: task.Tasks{
|
||||
"task-a": &task.Task{
|
||||
Deps: []string{"task-b"},
|
||||
},
|
||||
@@ -23,7 +23,7 @@ func TestCyclicDepCheck(t *testing.T) {
|
||||
}
|
||||
|
||||
isNotCyclic := &task.Executor{
|
||||
Tasks: map[string]*task.Task{
|
||||
Tasks: task.Tasks{
|
||||
"task-a": &task.Task{
|
||||
Deps: []string{"task-c"},
|
||||
},
|
||||
|
||||
5
task.go
5
task.go
@@ -20,13 +20,16 @@ const (
|
||||
|
||||
// Executor executes a Taskfile
|
||||
type Executor struct {
|
||||
Tasks map[string]*Task
|
||||
Tasks Tasks
|
||||
Force bool
|
||||
Watch bool
|
||||
|
||||
watchingFiles map[string]struct{}
|
||||
}
|
||||
|
||||
// Tasks representas a group of tasks
|
||||
type Tasks map[string]*Task
|
||||
|
||||
// Task represents a task
|
||||
type Task struct {
|
||||
Cmds []string
|
||||
|
||||
Reference in New Issue
Block a user