aboutsummaryrefslogtreecommitdiffstats
path: root/src/command/logout.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/command/client/logout.rs (renamed from src/command/logout.rs)7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/command/logout.rs b/src/command/client/logout.rs
index 26d689cf..a7e9541d 100644
--- a/src/command/logout.rs
+++ b/src/command/client/logout.rs
@@ -1,12 +1,15 @@
+use eyre::{Context, Result};
use fs_err::remove_file;
-pub fn run() {
+pub fn run() -> Result<()> {
let session_path = atuin_common::utils::data_dir().join("session");
if session_path.exists() {
- remove_file(session_path.as_path()).expect("Failed to remove session file");
+ remove_file(session_path.as_path()).context("Failed to remove session file")?;
println!("You have logged out!");
} else {
println!("You are not logged in");
}
+
+ Ok(())
}