Only run from_string conversion on strings#14509
Merged
fdncred merged 1 commit intonushell:mainfrom Dec 10, 2024
Merged
Conversation
Contributor
|
Thanks. Let's move forward while we still have some time to dogfood. |
Contributor
|
I'm afraid we have to revert the pr, currently this pr causes some strange troubles when I want to run a script inside neovim, or open terminal in editors: In neovim: :!black
shell failed to start: no such file or directory: nu
shell returned -1
Press ENTER or type command to continueIn zed editor, I can't open the terminal with following error: I noticed the issue might becuase we need to run |
WindSoilder
added a commit
to WindSoilder/nushell
that referenced
this pull request
Dec 18, 2024
This reverts commit fc29d82.
Contributor
|
I can't reproduce this @WindSoilder. I commented more on your revert PR. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
#14249 loaded
convert_env_values()several times to force more updates toENV_CONVERSION. This allows the user to treat variables as structured data insideconfig.nu(and others).Unfortunately,
convert_env_values()did not originally anticipate being called more than once, so it would attempt to re-convert values that had already been converted. This usually leads to an error in the conversion closure.With this PR, values are only converted with
from_stringif they are still strings; otherwise they are skipped and their existing value is used.User-Facing Changes
No user-facing change when compared to 0.100, since closures written for 0.100's
ENV_CONVERSIONnow work again without errors.Tests + Formatting
toolkit fmttoolkit clippytoolkit testtoolkit test stdlibAfter Submitting
Will remove the "workaround" from the Config doc preview.