-
- Notifications
You must be signed in to change notification settings - Fork 744
Open
Labels
state: needs triageWaiting to be triaged by a maintainer.Waiting to be triaged by a maintainer.
Description
Description
When setting an absolute directory (ex. /tmp) from a variable and using that in the dir:
directive of an included taskfile, it is treated as a relative path. However, it is dependent on the syntax of the include. Minimal working example included below.
When included using this syntax, the variable is treated as a relative path:
vars: TARGET_DIR: '/tmp' includes: broken: taskfile: ./Taskfile.broken.yml
When used like this:
tasks: broken: dir: "{{.TARGET_DIR}}" cmds: - | echo "PWD DIR: $(pwd)"
Version
3.45.4
Operating system
OSX 26
Experiments Enabled
No response
Example Taskfile
# Taskfile.yml version: '3' vars: TARGET_DIR: '/tmp' includes: working: ./Taskfile.working.yml broken: taskfile: ./Taskfile.broken.yml # this also doesn't fix it #vars: # TARGET_DIR: "{{.TARGET_DIR}}" tasks: default: cmds: - task: working:working - task: broken:broken
# Taskfile.working.yml version: '3' tasks: working: dir: "{{.TARGET_DIR}}" cmds: - | echo "TARGET_DIR: {{.TARGET_DIR}}" echo "PWD DIR: $(pwd)" cd {{.TARGET_DIR}} echo "PWD AFTER CD: $(pwd)"
# Taskfile.broken.yml version: '3' tasks: broken: dir: "{{.TARGET_DIR}}" cmds: - | echo "TARGET_DIR: {{.TARGET_DIR}}" echo "PWD DIR: $(pwd)" cd {{.TARGET_DIR}} echo "PWD AFTER CD: $(pwd)"
kappaj
Metadata
Metadata
Assignees
Labels
state: needs triageWaiting to be triaged by a maintainer.Waiting to be triaged by a maintainer.