mirror of
https://github.com/go-task/task.git
synced 2025-02-05 13:25:14 +02:00
Abstract Tasks type
This commit is contained in:
parent
09e6d5269d
commit
b530cba0d5
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user