Include history path in env command

This commit is contained in:
Pirmin Kalberer 2019-09-19 23:10:29 +02:00
parent 112e5d096f
commit 9623a255c4
2 changed files with 5 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,4 @@
use crate::cli::History;
use crate::data::config;
use crate::data::{Dictionary, Value};
use crate::errors::ShellError;
@ -45,6 +46,9 @@ pub fn get_environment(tag: Tag) -> Result<Tagged<Value>, Box<dyn std::error::Er
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));