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

Handle undefined environment variable #11480

Merged
merged 4 commits into from
Oct 6, 2023
Merged

Handle undefined environment variable #11480

merged 4 commits into from
Oct 6, 2023

Conversation

michelleangela
Copy link
Contributor

@michelleangela michelleangela commented Sep 28, 2023

Issue #11447.

This fixes the processing of an environment variable in CppProperties.resolveAndSplit and CppProperties.resolvePath.

Problem:
In util.resolvedVariable, process.env returns undefined if an environment variable is not found or available, and util.resolvedVariable will return the match ${env:VAR} if not resolved. The ${env:VAR} will then get split and appended to other paths incorrectly and processed as if it's the variable was resolved and would lead to incorrect values for other variables or paths.

Fix:
If an environment variable is not found or resolved, do not try to further change or process it.

sean-mcmanus
sean-mcmanus previously approved these changes Sep 29, 2023
@michelleangela michelleangela merged commit cd8ecf9 into main Oct 6, 2023
4 checks passed
@michelleangela michelleangela deleted the mimatias/env branch October 6, 2023 18:50
@github-actions github-actions bot locked and limited conversation to collaborators Nov 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants