mirror of
https://github.com/nushell/nushell.git
synced 2024-12-25 00:19:39 +01:00
Merge pull request #691 from pka/config-in-env
Include config paths in env command
This commit is contained in:
commit
d7d2a7ee77
@ -212,7 +212,7 @@ fn load_plugins(context: &mut Context) -> Result<(), ShellError> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
struct History;
|
||||
pub struct History;
|
||||
|
||||
impl History {
|
||||
pub fn path() -> PathBuf {
|
||||
|
@ -1,3 +1,5 @@
|
||||
use crate::cli::History;
|
||||
use crate::data::config;
|
||||
use crate::data::{Dictionary, Value};
|
||||
use crate::errors::ShellError;
|
||||
use crate::prelude::*;
|
||||
@ -41,6 +43,12 @@ pub fn get_environment(tag: Tag) -> Result<Tagged<Value>, Box<dyn std::error::Er
|
||||
indexmap.insert("home".to_string(), Value::path(home).tagged(tag));
|
||||
}
|
||||
|
||||
let config = config::default_path()?;
|
||||
indexmap.insert("config".to_string(), Value::path(config).tagged(tag));
|
||||
|
||||
let history = History::path();
|
||||
indexmap.insert("history".to_string(), Value::path(history).tagged(tag));
|
||||
|
||||
let temp = std::env::temp_dir();
|
||||
indexmap.insert("temp".to_string(), Value::path(temp).tagged(tag));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user