-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
fix(config): Restore old environment var behavior with option #13457
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
srebhan
force-pushed
the
config_issue_13432
branch
from
June 16, 2023 17:12
18de345
to
cf1a7ba
Compare
Please note that the replacement in |
This was referenced Jun 16, 2023
srebhan
added
the
ready for final review
This pull request has been reviewed and/or tested by multiple users and is ready for a final review.
label
Jun 16, 2023
Download PR build artifacts for linux_amd64.tar.gz, darwin_amd64.tar.gz, and windows_amd64.zip. 📦 Click here to get additional PR build artifactsArtifact URLs |
powersj
approved these changes
Jun 21, 2023
powersj
pushed a commit
that referenced
this pull request
Jun 21, 2023
(cherry picked from commit 47e10e1)
3 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
fix
pr to fix corresponding bug
ready for final review
This pull request has been reviewed and/or tested by multiple users and is ready for a final review.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
resolves #13456
resolves #13432
resolves #13455
resolves #13460
After a lot of back-and-forth this PR restores the old environment-variable behavior using the
--old-env-behavior
command line option. That is, all$VAR
and${VAR}
environment variables are replaced if and only if they do exist, otherwise those patterns are left untouched. Furthermore, double dollar signs$$
do not have any meaning so$$VAR
becomes$foobar
ifVAR="foobar"
in the environment.If the new behavior is enabled (default), the only difference is that
$$
will escape the expression, i.e.$$VAR
will become$VAR
even ifVAR
is defined in the environment...Here an exemplary overview of the behavior with
VAR="foo"
andFALLBACK="bar"
defined in the environemt:--old-env-behavior
--old-env-behavior
$VAR
foo
foo
$$VAR
$foo
$VAR
\$VAR
\foo
\foo
${VAR}
foo
foo
$${VAR}
$foo
${VAR}
\${VAR}
\foo
\foo
\$${VAR}
\$foo
\${VAR}
$FOO
$FOO
$FOO
${FOO}
${FOO}
${FOO}
$${FOO}
$${FOO}
${FOO}
${FOO:-${FALLBACK}}
bar
bar
${FOO:-FALLBACK}
FALLBACK
FALLBACK