mirror of
https://github.com/go-task/task.git
synced 2025-01-06 03:53:54 +02:00
Adding proper version checking for taskfile when using run
This commit is contained in:
parent
97c85e39c3
commit
bbe1d8b52e
8
task.go
8
task.go
@ -227,6 +227,9 @@ func (e *Executor) Setup() error {
|
||||
}
|
||||
}
|
||||
|
||||
if v < 3 && e.Taskfile.Run != "" {
|
||||
return errors.New(`task: Setting the "run" type is only available starting on Taskfile version v3`)
|
||||
}
|
||||
if e.Taskfile.Run == "" {
|
||||
e.Taskfile.Run = "always"
|
||||
}
|
||||
@ -264,6 +267,11 @@ func (e *Executor) Setup() error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
for _, task := range e.Taskfile.Tasks {
|
||||
if task.Run != "" {
|
||||
return errors.New(`task: Setting the "run" type is only available starting on Taskfile version v3`)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
e.execution = make(map[string]context.Context)
|
||||
|
Loading…
Reference in New Issue
Block a user