-
-
Notifications
You must be signed in to change notification settings - Fork 625
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
Define ENV vars not static #1630
Comments
Hello ! Env variable from the shell takes precedence over env defined in the Taskfile. |
Thanks for the link. It looks like the issue I just created is a duplicate. I'm going to close this issue. |
Even if it won't resolve your issue but you can use templating system and default pipe, and you can also define dynamic env variable like this : version: 3
tasks:
default:
env:
EBAR: "big env bar"
EBAZ:
sh: echo "big env baz"
vars:
VFOO: "little var foo"
VBAR: "little var bar"
cmds:
- cmd: echo {{.EFOO | default "little env foo"}}
- cmd: echo $EBAR
- cmd: echo $EBAZ
- cmd: echo {{.VFOO}}
- cmd: echo {{.VBAR}} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Given the current taskfile:
With the given invocation:
Outputs:
Since the ENV defined in the taskfile are static AND they are not using the
{{ default ...}}
pattern I would expect that all output says "little...". Am I mistaken? Also shouldn'tvars
andenv
behave the same?Thanks for clarifying this case.
The text was updated successfully, but these errors were encountered: