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

dir not set when using environment variables #1856

Open
yonas opened this issue Oct 5, 2024 · 0 comments
Open

dir not set when using environment variables #1856

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

Comments

@yonas
Copy link

yonas commented Oct 5, 2024

This fails to report inside dir /tmp/b:

> mkdir /tmp/{a,b}
> cd /tmp/a
> task -v
task: [/tmp/a] Not found - Using alternative (Taskfile.yaml)
task: "default" started
task: [default] echo tmpdir = $TMP
tmpdir = /tmp/b
task: [default] echo inside dir $PWD
inside dir /tmp/a
task: "default" finished

Taskfile.yaml

version: '3'

dotenv: [.env]

vars:
  tmpdir: $TMP

tasks:

  default:
    dir: "{{ .tmpdir }}"
    cmds:
      - echo tmpdir = {{ .tmpdir }}
      - echo inside dir $PWD

.env

TMP=/tmp/b

#1838 is similar but in this case, I'm using absolute paths.

I also noticed that if I try:

...
vars:
  tmpdir:
    sh: echo $TMP
...

The value of $TMP is not copied into the tmpdir variable.

@task-bot task-bot added the state: needs triage Waiting to be triaged by a maintainer. label Oct 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