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

No substitution when a var is assigned to itself #86

Open
huntc opened this issue Feb 4, 2021 · 2 comments
Open

No substitution when a var is assigned to itself #86

huntc opened this issue Feb 4, 2021 · 2 comments
Labels

Comments

@huntc
Copy link

huntc commented Feb 4, 2021

Variable expansion of an externally declared variable does not appear to occur when assigned back to the same variable name e.g. given the declaration of GITHUB_TOKEN, in my .env file:

GITHUB_TOKEN="$GITHUB_TOKEN"

...then show envFromFile from within the sbt session reveals:

[info] 	Map(GITHUB_TOKEN -> $GITHUB_TOKEN)

i.e. the token is not substituted where GITHUB_TOKEN has been declared prior to invoking sbt.

I'm not certain, but I think the following line is causing a problem:

      VariableExpansion.expandAllVars(sys.env ++ environment, environment)

i.e. the fact that environment is appended to sys.env.

@mefellows mefellows added the bug label Feb 27, 2021
@mefellows
Copy link
Collaborator

Thanks for raising, and apologies for my slow response. I don't spend much time on this these days, but if you care to submit a PR we'd be happy to bring it in.

P.S. interesting background, and hello fellow Aussie :)

@huntc
Copy link
Author

huntc commented Mar 1, 2021

Thanks @mefellows ! I’ll try and get a PR in!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants