-
-
Notifications
You must be signed in to change notification settings - Fork 763
Open
experiment
1 / 11 of 1 issue completed
Copy link
Labels
breaking changeChanges that are not backward compatible.Changes that are not backward compatible.status: stableExperimental feature - No more changes. Will be the default behavior in the next major release.Experimental feature - No more changes. Will be the default behavior in the next major release.
Description
Hey 👋
I guess I have found a bug yesterday on task: It looks like previously defined environment variable are not overwritten by the definition within the task file.
Taskfile
version: '3'
silent: true
tasks:
default:
env:
KEY: 'other'
cmds:
- echo "$KEY"Expected
I would expect the environment variable of KEY to be overwritten whatever the outside environment looks like.
$ task
other
$ KEY=some task
otherActual
The environment variable from the outside shell takes precedence over the variable defined within the taskfile.
$ task
other
$ KEY=some task
someOs + Taskfile-version
$ cat /etc/lsb-release
DISTRIB_ID=LinuxMint
DISTRIB_RELEASE=21.1
DISTRIB_CODENAME=vera
DISTRIB_DESCRIPTION="Linux Mint 21.1 Vera"
$ task --version
Task version: v3.21.0 (h1:pVGAGXxJ9Pk5mvjqv/CsdAD4ZIzNMjF+vrXMueM/WFk=)Why is that problem?
- I have not found any reference to that behavior in the docs.
- I love to clearly define my environment when using
taskrather than relying on any other outer state. In that case it's impossible to overwrite previously defined variables which may be a huge issue.
ricardogaspar2, matthchr, zbindenren, rjoelnorgren, gz-95 and 30 more
Sub-issues
Metadata
Metadata
Assignees
Labels
breaking changeChanges that are not backward compatible.Changes that are not backward compatible.status: stableExperimental feature - No more changes. Will be the default behavior in the next major release.Experimental feature - No more changes. Will be the default behavior in the next major release.
Type
Projects
Status
stable