Skip to content

Commit aba6824

Browse files
authored
fix: do not fail fast if history file is unwritable (#131)
1 parent 85a3dda commit aba6824

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

brush-interactive/src/interactive_shell.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,14 @@ impl InteractiveShell {
5252

5353
let mut editor = Self::new_editor(options, shell)?;
5454
if let Some(history_file_path) = &history_file_path {
55+
// If the history file doesn't already exist, then make a best-effort attempt.
56+
// to create it.
5557
if !history_file_path.exists() {
56-
std::fs::File::create(history_file_path)?;
58+
let _ = std::fs::File::create(history_file_path);
5759
}
5860

59-
editor.load_history(history_file_path)?;
61+
// Make a best effort attempt to load the history file.
62+
let _ = editor.load_history(history_file_path);
6063
}
6164

6265
Ok(InteractiveShell {

0 commit comments

Comments
 (0)