You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fixed#8870
In default_env.nu, environment variable NU_LIB_DIRS is derived from $nu.config-path now. If the config file is changed (e.g., by using --column), NU_LIB_DIRS is also changed.
This PR adds default-config-dir to $nu and fix default_env.nu to use default-config-dir for NU_LIB_DIRS definition.
User-Facing Changes
Users can use $nu.default-config-dir to specify the default config directory.
Tests + Formatting
$ use toolkit.nu # or use an `env_change` hook to activate it automatically
$ toolkit check pr
- :green_circle: `toolkit fmt`
- :green_circle: `toolkit clippy`
- :green_circle: `toolkit test`
- :green_circle: `toolkit test stdlib`
I'm fine with following @kubouch's lead here but this seems weird to me, even after following the other conversations.
If someone is specifying a --config /some/alternate/config.nu it seems reasonable to think that all their config settings, including NU_LIB_DIRS, would be based off of that new path, instead of "hard-coded" to the default path.
Having said that, it's easy enough to change the env.nu to point to $nu.config-path instead of $nu.default-config-path
If someone is specifying a --config /some/alternate/config.nu it seems reasonable to think that all their config settings, including NU_LIB_DIRS, would be based off of that new path, instead of "hard-coded" to the default path.
I agree with you.
Following your comment, I think that only adding default-config-path is enough in this PR. Should we change NU_LIB_DIRS in default_env.nu?
(I forgot to commit my test changes. I will add it.)
It's not only the --config flag but also symlink resolving that changes the config-path. If you have a config symlinked in your default config directory, the config-path will point at different location than the default directory. In that case you still want to refer to the default directory. I'm thinking having a default static NU_LIB_DIRS would make the default behavior more predictable, you can always easily change in your config.
Users using a custom config directory will be affected when they replace their env.nu to default_env.nu. One option is not to change default_env.nu to respect the existing configuration, but which is the best?
I'd mark it as a breaking change because it changes default env.nu. But actually, what this PR does is that it brings the defalt behavior back after #8792 which caused the breaking change.
I'd mark it as a breaking change because it changes default env.nu. But actually, what this PR does is that it brings the defalt behavior back after #8792 which caused the breaking change.
I don't see how #8792 should have changed the NU_LIB_DIRS behavior. It only affects the behavior of config nu and config env?
Might this be related to one of the IDE PRs?
bobhy
pushed a commit
to bobhy/nushell
that referenced
this pull request
Apr 15, 2023
@sholderbachThis line used to depend on $nu.config-path which became volatile after the 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
notes:breaking-changesThis PR implies a change affecting users and has to be noted in the release notes
4 participants
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
fixed #8870
In
default_env.nu, environment variableNU_LIB_DIRSis derived from$nu.config-pathnow. If the config file is changed (e.g., by using--column),NU_LIB_DIRSis also changed.This PR adds
default-config-dirto $nu and fixdefault_env.nuto usedefault-config-dirforNU_LIB_DIRSdefinition.User-Facing Changes
Users can use
$nu.default-config-dirto specify the default config directory.Tests + Formatting
After Submitting
nothing