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

Merge branch 'include-homedir' of https://github.com/amancevice/task into amancevice-include-homedir

This commit is contained in:
Andrey Nering
2021-09-06 10:24:23 -03:00

View File

@@ -9,6 +9,7 @@ import (
"gopkg.in/yaml.v3"
"github.com/go-task/task/v3/internal/execext"
"github.com/go-task/task/v3/internal/templater"
"github.com/go-task/task/v3/taskfile"
)
@@ -49,10 +50,13 @@ func Taskfile(dir string, entrypoint string) (*taskfile.Taskfile, error) {
}
}
if filepath.IsAbs(includedTask.Taskfile) {
path = includedTask.Taskfile
} else {
path = filepath.Join(dir, includedTask.Taskfile)
path, err := execext.Expand(includedTask.Taskfile)
if err != nil {
return err
}
if ! filepath.IsAbs(path) {
path = filepath.Join(dir, path)
}
info, err := os.Stat(path)