-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Have $env.ENV_CONVERSIONS changes take place immediately #14514
Copy link
Copy link
Closed
Labels
A:environmentRelated to the management of environment variables/process stateRelated to the management of environment variables/process statecategory:enhancementNew feature or requestNew feature or requeststatus:needs-triageAn issue that hasn't had any proper lookAn issue that hasn't had any proper look
Milestone
Description
Related problem
Tossing this in so we don't lose track of it.
nu_engine::convert_env_values() is the function which handles ENV_CONVERSIONS for from_string. Currently, it has to be run "manually", so we do this several times during startup, basically whenever we know that we've changed, or assume that the user has changed, the $env.ENV_CONVERSIONS.
- Immediately after
default_env.nuis evaluated, to pick up thePATHconversion in that file. - Immediately before the user's
config.nuso that any changes they've made in theirenv.nucan be used. - After the user's
env.nuin case they made any additional changes there.
Changes to the from_string in ENV_CONVERSIONS are never used.
Describe the solution you'd like
Things could be streamlined quite a bit if we run nu_engine::convert_env_values() any time that $env.ENV_CONVERSIONS is updated.
- We'd avoid a few potentially unnecessary calls.
- The user could change
$env.ENV_CONVERSIONSand make use of them in the same file (e.g.,config.nu). This could allow the user to go without anenv.nuentirely in many cases. - The user (or even third-party code) could update
$env.ENV_CONVERSIONSat any point after startup and add new conversions.
Describe alternatives you've considered
No response
Additional context and details
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A:environmentRelated to the management of environment variables/process stateRelated to the management of environment variables/process statecategory:enhancementNew feature or requestNew feature or requeststatus:needs-triageAn issue that hasn't had any proper lookAn issue that hasn't had any proper look