-
-
Notifications
You must be signed in to change notification settings - Fork 715
Open
Labels
state: needs triageWaiting to be triaged by a maintainer.Waiting to be triaged by a maintainer.
Description
Description
I wanted to use a global vars:
key to default to the .CLI_ARGS special var.
vars:
ENV: '{{.ENV | default .CLI_ARGS}}'
And then use it in a task, so both of these examples work:
task debug -- dev # Should use 'dev' as value for `ENV`
task debug ENV=dev # Should behave similarly as `-- dev`
The above behavior works if vars:
is used directly in the task definition:
tasks:
debug:
vars:
ENV: '{{.ENV | default .CLI_ARGS}}'
cmds:
- echo '{{.ENV}}'
Only when using vars:
globally .CLI_ARGS
comes empty and doesn't work.
Version
v3.41.0 (h1:giUddhe0XZLbEWIQ/MuTPipR9ek+teulIA5xf/2IHXg=)
Operating system
macOS Sequioa 15.3.1 (24D70)
Experiments Enabled
No response
Example Taskfile
version: '3'
vars:
ENV: '{{.ENV | default .CLI_ARGS}}'
tasks:
debug:
cmds:
- echo '{{.ENV}}'
Metadata
Metadata
Assignees
Labels
state: needs triageWaiting to be triaged by a maintainer.Waiting to be triaged by a maintainer.