Closed as duplicate of#1038
Description
Hi, I think the order of importance as listed here: https://taskfile.dev/usage/#variables, doesn't really make a lot of sense.
- Variables declared in the task definition
- Variables given while calling a task from another (See Calling another task above)
- Variables of the included Taskfile (when the task is included)
- Variables of the inclusion of the Taskfile (when the task is included)
- Global variables (those declared in the vars: option in the Taskfile)
- Environment variables
In my opinion, env vars should have the highest priority. Otherwise, it becomes really akward to have default values that someone can overwrite when invoking the cli.
Given I have the below taskfile, I cannot change the value of version from the outside, making it kind of pointless.
version: "3"
env:
VERSION: dev
tasks:
default:
cmd: echo {{.VERSION}}
It would be nice to be able to do VERSION=1 task
and have it pick it up. That would feel to me, much more natural and intutive, as I am used to this kind of pattern from other tools.
Metadata
Metadata
Assignees
Labels
No labels