diff --git a/crates/nu-command/src/env/config/config_env.rs b/crates/nu-command/src/env/config/config_env.rs index dd0fad7a90..e1693b392f 100644 --- a/crates/nu-command/src/env/config/config_env.rs +++ b/crates/nu-command/src/env/config/config_env.rs @@ -42,21 +42,18 @@ impl Command for ConfigEnv { input: PipelineData, ) -> Result { let env_vars_str = env_to_strings(engine_state, stack)?; - let mut config_path = match nu_path::config_dir() { - Some(path) => path, + let nu_config = match engine_state.get_config_path("env-path") { + Some(path) => path.clone(), None => { return Err(ShellError::GenericError( - "Could not find nu env path".to_string(), - "Could not find nu env path".to_string(), + "Could not find $nu.env-path".to_string(), + "Could not find $nu.env-path".to_string(), None, None, Vec::new(), )); } }; - config_path.push("nushell"); - let mut nu_config = config_path.clone(); - nu_config.push("env.nu"); let (item, config_args) = get_editor(engine_state, stack, call.head)?; diff --git a/crates/nu-command/src/env/config/config_nu.rs b/crates/nu-command/src/env/config/config_nu.rs index f03f798e8d..1591942f9a 100644 --- a/crates/nu-command/src/env/config/config_nu.rs +++ b/crates/nu-command/src/env/config/config_nu.rs @@ -42,21 +42,18 @@ impl Command for ConfigNu { input: PipelineData, ) -> Result { let env_vars_str = env_to_strings(engine_state, stack)?; - let mut config_path = match nu_path::config_dir() { - Some(path) => path, + let nu_config = match engine_state.get_config_path("config-path") { + Some(path) => path.clone(), None => { return Err(ShellError::GenericError( - "Could not find nu config path".to_string(), - "Could not find nu config path".to_string(), + "Could not find $nu.config-path".to_string(), + "Could not find $nu.config-path".to_string(), None, None, Vec::new(), )); } }; - config_path.push("nushell"); - let mut nu_config = config_path.clone(); - nu_config.push("config.nu"); let (item, config_args) = get_editor(engine_state, stack, call.head)?;