-
Notifications
You must be signed in to change notification settings - Fork 87
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
Add environment variable replacement to GetStringValueOrDefault #57
Conversation
I only use config files.. but having to put 'relative pathing' (....\ notation) everywhere is painful. I would much rather just use a token that gets expanded at runtime |
I can confirm this works perfectly for me.. as long as the {varaible} token is not typically used in any existing parameter/config this should be fine for everyone else too. If somehow a token appeared, it would get replaced with an empty string as the environment variable won't exist |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the feature. I am worried that opening and closing brackets is not unique enough to be sure the intention was an environment variable. I'm wondering if we should follow MSBuild precedence and use $(VARIABLE) instead.
Also can you add some unit tests for this feature? You should be able to write tests with by setting environment variable in the test, create a command and then call GetStringValueOrDefault().
what the token is - doesnt matter - its a regex. I just need any form of token replacement so I don't have to make convoluted config files. I'll change to $(VARIABLE) and make some unit tests |
unit tests
This has been released as part of version 3.1.0 of Amazon.ElasticBeanstalk.Tools. Thanks for the PR and patience to get this out. |
Description of changes:
Allows a config file to use $(VARIABLE) that will be replaced with environment variables at run-time.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.