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

cli: do not panic in env set foo bar "" #110

Merged
merged 2 commits into from
Oct 12, 2023
Merged

cli: do not panic in env set foo bar "" #110

merged 2 commits into from
Oct 12, 2023

Conversation

pgavlin
Copy link
Member

@pgavlin pgavlin commented Oct 12, 2023

After interpretation by the shell, env set foo bar "" passes an empty string as the value to set. The YAML parser treats the empty string as "no document" and doesn't return any content from Unmarshal. Work around this by treating "no document" as an empty string literal (which is likely the intent).

Fixes #109.

After interpretation by the shell, `env set foo bar ""` passes an empty
string as the value to set. The YAML parser treats the empty string as
"no document" and doesn't return any content from Unmarshal. Work around
this by treating "no document" as an empty string _literal_ (which is
likely the intent).

Fixes #109.
@pgavlin pgavlin merged commit e0462cc into main Oct 12, 2023
@pgavlin pgavlin deleted the pgavlin/gh109 branch October 12, 2023 16:40
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.

Setting a value to "" causes a panic
2 participants