summaryrefslogtreecommitdiffstats
path: root/src/command/logout.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/command/logout.rs')
-rw-r--r--src/command/logout.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/command/logout.rs b/src/command/logout.rs
new file mode 100644
index 00000000..ec7d8dcb
--- /dev/null
+++ b/src/command/logout.rs
@@ -0,0 +1,12 @@
+use std::fs::remove_file;
+
+pub fn run() {
+ 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");
+ println!("You have logged out!");
+ } else {
+ println!("You are not logged in");
+ }
+}