forked from extern/nushell
Add env.nu file for environment config (#5099)
* Add env.nu file for environment config * Add missing flag * Add $nu.env-path variable Prints `env.nu` path * Add example of adding entries to PATH
This commit is contained in:
@ -1142,6 +1142,7 @@ pub fn eval_variable(
|
||||
|
||||
if let Some(mut config_path) = nu_path::config_dir() {
|
||||
config_path.push("nushell");
|
||||
let mut env_config_path = config_path.clone();
|
||||
|
||||
let mut history_path = config_path.clone();
|
||||
|
||||
@ -1160,6 +1161,14 @@ pub fn eval_variable(
|
||||
val: config_path.to_string_lossy().to_string(),
|
||||
span,
|
||||
});
|
||||
|
||||
env_config_path.push("env.nu");
|
||||
|
||||
output_cols.push("env-path".into());
|
||||
output_vals.push(Value::String {
|
||||
val: env_config_path.to_string_lossy().to_string(),
|
||||
span,
|
||||
});
|
||||
}
|
||||
|
||||
#[cfg(feature = "plugin")]
|
||||
|
Reference in New Issue
Block a user