Extract .nu-env tests and more granularity - #3078
Merged
Merged
Conversation
andrasio
force-pushed
the
documentacion
branch
2 times, most recently
from
February 19, 2021 00:46
a00ff66 to
49f5bfe
Compare
The autoenv logic mutates environment variables in the running session as it operates and decides what to do for trusted directories containing `.nu-env` files. Few of the ways to interact with it were all in a single test function. We separate out all the ways that were done in the single test function to document it better. This will greatly help once we start refactoring our way out from setting environment variables this way to just setting them to `Scope`. This is part of an on-going effort to keep variables (`PATH` and `ENV`) in our `Scope` and rely on it for everything related to variables. We expect to move away from setting (`std::*`) envrironment variables in the current running process. This is non-trivial since we need to handle cases from vars coming in from the outside world, prioritize, and also compare to the ones we have both stored in memory and in configuration files. Also to send out our in-memory (in `Scope`) variables properly to external programs once we no longer rely on `std::env` vars from the running process.
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.
The autoenv logic mutates environment variables in the running session as it operates and decides what to do for trusted directories containing
.nu-envfiles. Few of the ways to interact with it were all in a single test function.We separate out all the ways that were done in the single test function to document it better. This will greatly help once we start refactoring our way out from setting environment variables this way to just setting them to
Scope.This is part of an on-going effort to keep variables (
PATHandENV) in ourScopeand rely on it for everything related to variables.We expect to move away from setting (
std::*) envrironment variables in the current running process. This is non-trivial since we need to handle cases from vars coming in from the outside world, prioritize, and also compare to the ones we have both stored in memory and in configuration files.Also to send out our in-memory (in
Scope) variables properly to external programs once we no longer rely onstd::envvars from the running process.