Change history.txt dir

This commit is contained in:
dvishal485 2023-11-29 22:36:08 +05:30 committed by PaddiM8
parent 61a6cd861d
commit bdb7502e9d

View File

@ -34,12 +34,12 @@ pub fn start(parser: &mut parser::Context, precision: u32) {
// Load history // Load history
let mut history_path = None; let mut history_path = None;
if let Some(config_path) = dirs::config_dir() { if let Some(cache_path) = dirs::cache_dir() {
let mut config_path = config_path; let mut cache_path = cache_path;
config_path.push("kalker"); cache_path.push("kalker");
if fs::create_dir_all(config_path.as_path()).is_ok() { if fs::create_dir_all(cache_path.as_path()).is_ok() {
config_path.push("history.txt"); cache_path.push("history.txt");
let history = config_path.into_os_string().into_string().unwrap(); let history = cache_path.into_os_string().into_string().unwrap();
editor.load_history(&history).ok(); editor.load_history(&history).ok();
history_path = Some(history) history_path = Some(history)
} }