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:
committed by
GitHub
parent
c5eea294aa
commit
a72e70b026
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user