1
0
mirror of https://github.com/go-task/task.git synced 2025-06-15 00:15:10 +02:00

feat: add ROOT_TASKFILE special variable (#1469)

This commit is contained in:
Pete Davison
2024-01-26 00:11:08 +00:00
committed by GitHub
parent 6ebe2e765f
commit 3ff8fdbc0a
3 changed files with 6 additions and 2 deletions

View File

@ -20,6 +20,7 @@ import (
type Compiler struct {
Dir string
Entrypoint string
UserWorkingDir string
TaskfileEnv *ast.Vars
@ -214,6 +215,7 @@ func (c *Compiler) getSpecialVars(t *ast.Task) (map[string]string, error) {
return map[string]string{
"TASK": t.Task,
"ROOT_TASKFILE": filepathext.SmartJoin(c.Dir, c.Entrypoint),
"ROOT_DIR": c.Dir,
"TASKFILE_DIR": taskfileDir,
"USER_WORKING_DIR": c.UserWorkingDir,