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

Taskfile doesn't expand env vars in global variable section #1580

Open
sdmitriev1 opened this issue Apr 5, 2024 · 0 comments
Open

Taskfile doesn't expand env vars in global variable section #1580

sdmitriev1 opened this issue Apr 5, 2024 · 0 comments
Labels
state: needs triage Waiting to be triaged by a maintainer.

Comments

@sdmitriev1
Copy link

  • Task version: 3.33.1
  • Operating system: MacOS 14.4.1
  • Experiments enabled: none

Taskfile.yml:

---
version: "3"

vars:
  PATH: /tmp/{{ .NAME }}/.tmp

tasks:
  print:
    cmds:
      - echo {{ .NAME }}
      - echo {{ .PATH }}

the result of the task:

[]$ task print NAME="test"
task: [print] echo test
test
task: [print] echo /tmp//.tmp
/tmp//.tmp

I didn't find any reference to it in the documentation, but it looks like Taskfile does not expand the environmental variable properly, variable NAME is expanded in the task section, but when it's assigned to another var in global section (PATH: /tmp/{{ .NAME }}/.tmp it's just empty string instead

@task-bot task-bot added the state: needs triage Waiting to be triaged by a maintainer. label Apr 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state: needs triage Waiting to be triaged by a maintainer.
Projects
None yet
Development

No branches or pull requests

2 participants