1
0
mirror of https://github.com/go-task/task.git synced 2025-11-23 22:24:45 +02:00

fix: better error when a Taskfile does not exist in include (#2494)

This commit is contained in:
Valentin Maerten
2025-11-11 20:37:24 +01:00
committed by GitHub
parent 19f72b7eb0
commit 17757c0c15
2 changed files with 6 additions and 2 deletions

View File

@@ -5,6 +5,7 @@ import (
"os"
"path/filepath"
"github.com/go-task/task/v3/errors"
"github.com/go-task/task/v3/internal/execext"
"github.com/go-task/task/v3/internal/filepathext"
"github.com/go-task/task/v3/internal/fsext"
@@ -20,6 +21,9 @@ func NewFileNode(entrypoint, dir string, opts ...NodeOption) (*FileNode, error)
// Find the entrypoint file
resolvedEntrypoint, err := fsext.Search(entrypoint, dir, defaultTaskfiles)
if err != nil {
if errors.Is(err, os.ErrNotExist) {
return nil, errors.TaskfileNotFoundError{URI: entrypoint, Walk: false}
}
return nil, err
}