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

fix: inconsistent current directory resolution depending on include order (#1757)

This commit is contained in:
Paulo Bittencourt
2024-10-05 20:40:22 -04:00
committed by GitHub
parent c5eea294aa
commit a72e70b026
6 changed files with 137 additions and 2 deletions

View File

@@ -110,8 +110,12 @@ func (node *HTTPNode) ResolveDir(dir string) (string, error) {
// NOTE: Uses the directory of the entrypoint (Taskfile), not the current working directory
// This means that files are included relative to one another
entrypointDir := filepath.Dir(node.Dir())
return filepathext.SmartJoin(entrypointDir, path), nil
parent := node.Dir()
if node.Parent() != nil {
parent = node.Parent().Dir()
}
return filepathext.SmartJoin(parent, path), nil
}
func (node *HTTPNode) FilenameAndLastDir() (string, string) {