Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Declared env vars do not take precedence over existing env vars #436

Closed
ahawkins opened this issue Jan 27, 2021 · 1 comment
Closed

Declared env vars do not take precedence over existing env vars #436

ahawkins opened this issue Jan 27, 2021 · 1 comment
Labels
type: bug Something not working as intended.

Comments

@ahawkins
Copy link

ahawkins commented Jan 27, 2021

  • Task version: 3.2.2
  • Operating System: macOS

Example Taskfile showing the issue

version: "3"

env:
  DUMMY: "foo"

tasks:
  default:
    cmds:
      - echo "DUMMY=${DUMMY}"

Example Behavior

$ task -s
DUMMY=foo
$ env DUMMY=placeholder task -s
DUMMY=placeholder

Expectation

$ env DUMMY=placeholder task -s
DUMMY=foo

Outputs the value declared in the Taskfile.

Value declared in env is used for tasks irregardless to existing values. This used to work in a previous version, not sure where it stopped.

@ahawkins ahawkins added the type: bug Something not working as intended. label Jan 27, 2021
@andreynering
Copy link
Member

Hi @ahawkins, thanks for opening this issue!

Actually, the behavior was kinda undefined (and undocumented) before. It could take one variable or the other depending on the name.

After v3.2.2, we determined that system env have preference over Taskfile envs. See the CHANGELOG and #425.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something not working as intended.
Projects
None yet
Development

No branches or pull requests

2 participants