mirror of
https://github.com/nushell/nushell.git
synced 2025-01-12 09:18:56 +01:00
Rename config function
This commit is contained in:
parent
2770a6f5e4
commit
e4c951fe93
@ -4,7 +4,7 @@ use std::fmt::Debug;
|
||||
pub trait Conf: Debug + Send {
|
||||
fn env(&self) -> Option<Value>;
|
||||
fn path(&self) -> Option<Value>;
|
||||
fn direnv_whitelist(&self) -> Option<Value>;
|
||||
fn nu_env_dirs(&self) -> Option<Value>;
|
||||
fn reload(&self);
|
||||
}
|
||||
|
||||
@ -13,8 +13,8 @@ impl Conf for Box<dyn Conf> {
|
||||
(**self).env()
|
||||
}
|
||||
|
||||
fn direnv_whitelist(&self) -> Option<Value> {
|
||||
(**self).direnv_whitelist()
|
||||
fn nu_env_dirs(&self) -> Option<Value> {
|
||||
(**self).nu_env_dirs()
|
||||
}
|
||||
|
||||
fn path(&self) -> Option<Value> {
|
||||
|
@ -20,8 +20,8 @@ impl Conf for NuConfig {
|
||||
self.path()
|
||||
}
|
||||
|
||||
fn direnv_whitelist(&self) -> Option<Value> {
|
||||
self.direnv_whitelist()
|
||||
fn nu_env_dirs(&self) -> Option<Value> {
|
||||
self.nu_env_dirs()
|
||||
}
|
||||
|
||||
fn reload(&self) {
|
||||
@ -56,7 +56,7 @@ impl NuConfig {
|
||||
None
|
||||
}
|
||||
|
||||
pub fn direnv_whitelist(&self) -> Option<Value> {
|
||||
pub fn nu_env_dirs(&self) -> Option<Value> {
|
||||
let vars = self.vars.lock();
|
||||
if let Some(dirs) = vars.get("nu_env_dirs") {
|
||||
return Some(dirs.clone());
|
||||
|
2
crates/nu-cli/src/env/environment.rs
vendored
2
crates/nu-cli/src/env/environment.rs
vendored
@ -54,7 +54,7 @@ impl Environment {
|
||||
Environment {
|
||||
environment_vars: env,
|
||||
path_vars: path,
|
||||
direnv: DirectorySpecificEnvironment::new(configuration.direnv_whitelist()),
|
||||
direnv: DirectorySpecificEnvironment::new(configuration.nu_env_dirs()),
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user