1
0
mirror of https://github.com/go-task/task.git synced 2025-08-10 22:42:19 +02:00

feat: error handling for undefined schema version (#1342)

* feat: error handling for undefined schema version

* docs: error codes

* chore: changelog
This commit is contained in:
Pete Davison
2023-09-19 13:21:40 -05:00
committed by GitHub
parent b1ff13d3e8
commit 078e213890
5 changed files with 38 additions and 3 deletions

View File

@@ -147,6 +147,11 @@ func Taskfile(
return nil, err
}
// Check that the Taskfile is set and has a schema version
if t == nil || t.Version == nil {
return nil, &errors.TaskfileVersionNotDefined{URI: node.Location()}
}
// Annotate any included Taskfile reference with a base directory for resolving relative paths
if node, isFileNode := node.(*FileNode); isFileNode {
_ = t.Includes.Range(func(key string, includedFile taskfile.IncludedTaskfile) error {