Merge pull request #691 from pka/config-in-env

Include config paths in env command
This commit is contained in:
Jonathan Turner 2019-09-21 04:19:24 +12:00 committed by GitHub
commit d7d2a7ee77
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 1 deletions

View File

@ -212,7 +212,7 @@ fn load_plugins(context: &mut Context) -> Result<(), ShellError> {
Ok(())
}
struct History;
pub struct History;
impl History {
pub fn path() -> PathBuf {

View File

@ -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));