mirror of
https://github.com/go-task/task.git
synced 2026-02-24 03:59:52 +01:00
fix: correct the value of ROOT_TASKFILE when no entrypoint (#2635)
This commit is contained in:
@@ -364,6 +364,7 @@ func TestSpecialVars(t *testing.T) {
|
||||
// Root
|
||||
"print-task",
|
||||
"print-root-dir",
|
||||
"print-root-taskfile",
|
||||
"print-taskfile",
|
||||
"print-taskfile-dir",
|
||||
"print-task-dir",
|
||||
|
||||
1
setup.go
1
setup.go
@@ -67,6 +67,7 @@ func (e *Executor) getRootNode() (taskfile.Node, error) {
|
||||
return nil, err
|
||||
}
|
||||
e.Dir = node.Dir()
|
||||
e.Entrypoint = node.Location()
|
||||
return node, err
|
||||
}
|
||||
|
||||
|
||||
1
testdata/special_vars/Taskfile.yml
vendored
1
testdata/special_vars/Taskfile.yml
vendored
@@ -11,6 +11,7 @@ tasks:
|
||||
cmds:
|
||||
- echo {{.TASK}}
|
||||
print-root-dir: echo {{.ROOT_DIR}}
|
||||
print-root-taskfile: echo {{.ROOT_TASKFILE}}
|
||||
print-taskfile: echo {{.TASKFILE}}
|
||||
print-taskfile-dir: echo {{.TASKFILE_DIR}}
|
||||
print-task-version: echo {{.TASK_VERSION}}
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
{{.TEST_DIR}}/testdata/special_vars/Taskfile.yml
|
||||
@@ -0,0 +1 @@
|
||||
{{.TEST_DIR}}/testdata/special_vars/Taskfile.yml
|
||||
Reference in New Issue
Block a user