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

fix: parsing multiline brew output #1348

Merged
merged 1 commit into from
Aug 20, 2024
Merged

fix: parsing multiline brew output #1348

merged 1 commit into from
Aug 20, 2024

Conversation

mistydemeo
Copy link
Contributor

The brew bundle exec -- /usr/bin/env output now contains multiline strings, which I should always have been guarding against anyway. This updates us to use the -0 option to env, which separates lines in the output by nul bytes instead of newlines - that way we can more safely parse the output of environment variables containing newlines.

Copy link
Contributor

@Gankra Gankra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if an env-var has a trailing newline..?

cargo-dist/src/env.rs Outdated Show resolved Hide resolved
The `brew bundle exec -- /usr/bin/env` output now contains multiline
strings, which I should always have been guarding against anyway.
This updates us to use the `-0` option to `env`, which separates
lines in the output by nul bytes instead of newlines - that way
we can more safely parse the output of environment variables containing
newlines.
@Gankra Gankra merged commit e8ea60a into main Aug 20, 2024
16 checks passed
@Gankra Gankra deleted the brew_fix_env_parsing branch August 20, 2024 16:36
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

Successfully merging this pull request may close these issues.

2 participants