Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change history.txt directory (resolve #123) #126

Merged
merged 1 commit into from
Nov 29, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions cli/src/repl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ pub fn start(parser: &mut parser::Context, precision: u32) {

// Load history
let mut history_path = None;
if let Some(config_path) = dirs::config_dir() {
let mut config_path = config_path;
config_path.push("kalker");
if fs::create_dir_all(config_path.as_path()).is_ok() {
config_path.push("history.txt");
let history = config_path.into_os_string().into_string().unwrap();
if let Some(cache_path) = dirs::cache_dir() {
let mut cache_path = cache_path;
cache_path.push("kalker");
if fs::create_dir_all(cache_path.as_path()).is_ok() {
cache_path.push("history.txt");
let history = cache_path.into_os_string().into_string().unwrap();
editor.load_history(&history).ok();
history_path = Some(history)
}
Expand Down
Loading