1
0
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:
Ross Hammermeister 2020-08-26 11:10:27 -06:00 committed by Andrey Nering
parent 97c85e39c3
commit bbe1d8b52e

View File

@ -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)