From 7436e4ff651b64d4019a59d04c30c414ae220403 Mon Sep 17 00:00:00 2001 From: Conrad Ludgate Date: Fri, 22 Apr 2022 21:14:23 +0100 Subject: feature-flags (#328) * use feature flags * fmt * fix features * update ci * fmt Co-authored-by: Ellie Huxtable --- src/command/client/sync/logout.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 src/command/client/sync/logout.rs (limited to 'src/command/client/sync/logout.rs') diff --git a/src/command/client/sync/logout.rs b/src/command/client/sync/logout.rs new file mode 100644 index 00000000..a7e9541d --- /dev/null +++ b/src/command/client/sync/logout.rs @@ -0,0 +1,15 @@ +use eyre::{Context, Result}; +use fs_err::remove_file; + +pub fn run() -> Result<()> { + let session_path = atuin_common::utils::data_dir().join("session"); + + if session_path.exists() { + 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(()) +} -- cgit v1.3.1