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

default env vars #246

Closed
retr0h opened this issue May 13, 2020 · 0 comments
Closed

default env vars #246

retr0h opened this issue May 13, 2020 · 0 comments

Comments

@retr0h
Copy link

retr0h commented May 13, 2020

I'm trying to understand how to use default and env together. I thought I might get fancy and simply add another variable with the value of env. However, if env fails to find the env var, it must return an empty string or something, b/c NEW_VERSION is always empty, unless command is prefixed with VERSION=foo.

I am sure I am going about this completely wrong, but was hoping to override VERSION similar to Make's FOO:=bar.

VERSION:
  sh: git describe --tags --always
SET_VERSION: '{{ env "VERSION" }}'
NEW_VERSION: '{{ default .VERSION .SET_VERSION }}'
@retr0h retr0h closed this as completed May 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant