Fix nushell local env detection by using direnv export (#13902)
I don't intend fully on getting this merged, this is just an experiment on using `direnv` directly without relying on shell-specific behaviours. It works though, so this finally closes #8633 Release Notes: - Fixed nushell not picking up `direnv` environments by directly interfacing with it using `direnv export` --------- Co-authored-by: Thorsten Ball <mrnugget@gmail.com>
This commit is contained in:
parent
9f5309cedd
commit
8abc000553
4 changed files with 90 additions and 3 deletions
|
@ -20,6 +20,23 @@ pub struct ProjectSettings {
|
|||
/// Configuration for Git-related features
|
||||
#[serde(default)]
|
||||
pub git: GitSettings,
|
||||
|
||||
/// Configuration for how direnv configuration should be loaded
|
||||
#[serde(default)]
|
||||
pub load_direnv: DirenvSettings,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Default, Serialize, Deserialize, JsonSchema)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
pub enum DirenvSettings {
|
||||
/// Load direnv configuration through a shell hook
|
||||
#[default]
|
||||
ShellHook,
|
||||
/// Load direnv configuration directly using `direnv export json`
|
||||
///
|
||||
/// Warning: This option is experimental and might cause some inconsistent behaviour compared to using the shell hook.
|
||||
/// If it does, please report it to GitHub
|
||||
Direct,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, Default, Serialize, Deserialize, JsonSchema)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue