fix: improve error message when searching for Taskfile. (#2682)

This commit is contained in:
Timothy Rule
2026-02-15 14:56:35 +01:00
committed by GitHub
parent c0ff7105e7
commit f63a63fa6c
5 changed files with 32 additions and 19 deletions

View File

@@ -11,14 +11,17 @@ import (
// TaskfileNotFoundError is returned when no appropriate Taskfile is found when
// searching the filesystem.
type TaskfileNotFoundError struct {
URI string
Walk bool
AskInit bool
URI string
Walk bool
AskInit bool
OwnerChange bool
}
func (err TaskfileNotFoundError) Error() string {
var walkText string
if err.Walk {
if err.OwnerChange {
walkText = " (or any of the parent directories until ownership changed)."
} else if err.Walk {
walkText = " (or any of the parent directories)."
}
if err.AskInit {