fix: CLI variables should take priority over Taskfile defaults by vmaerten · Pull Request #2589 · go-task/task
vmaerten
marked this pull request as ready for review
When using `task FOO=bar` with a Taskfile containing
`FOO: '{{.FOO | default "foo"}}'`, the CLI value was being
overwritten by the Taskfile default.
Split the variable merging into two steps:
1. Merge CLI variables (FOO=bar) first so they override Taskfile vars
2. ReverseMerge special variables (CLI_ARGS, CLI_FORCE, etc.) so
they're available for templating in Taskfile vars
Fixes regression introduced in #2403.
Co-authored-by: Timothy Rule <timothy.rule@gmail.com>
Copilot AI pushed a commit to libor-m/task that referenced this pull request
Mar 27, 2026…sk#2589) When using `task FOO=bar` with a Taskfile containing `FOO: '{{.FOO | default "foo"}}'`, the CLI value was being overwritten by the Taskfile default. Split the variable merging into two steps: 1. Merge CLI variables (FOO=bar) first so they override Taskfile vars 2. ReverseMerge special variables (CLI_ARGS, CLI_FORCE, etc.) so they're available for templating in Taskfile vars Fixes regression introduced in go-task#2403. Co-authored-by: Timothy Rule <timothy.rule@gmail.com> Co-authored-by: libor-m <1497769+libor-m@users.noreply.github.com>
Copilot AI pushed a commit to libor-m/task that referenced this pull request
Mar 27, 2026This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters