aboutsummaryrefslogtreecommitdiffstats
path: root/src/command/client/sync/logout.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/command/client/sync/logout.rs12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/command/client/sync/logout.rs b/src/command/client/sync/logout.rs
index a7e9541d..90b49d6d 100644
--- a/src/command/client/sync/logout.rs
+++ b/src/command/client/sync/logout.rs
@@ -1,11 +1,15 @@
+use std::path::PathBuf;
+
use eyre::{Context, Result};
use fs_err::remove_file;
-pub fn run() -> Result<()> {
- let session_path = atuin_common::utils::data_dir().join("session");
+use atuin_client::settings::Settings;
+
+pub fn run(settings: &Settings) -> Result<()> {
+ let session_path = settings.session_path.as_str();
- if session_path.exists() {
- remove_file(session_path.as_path()).context("Failed to remove session file")?;
+ if PathBuf::from(session_path).exists() {
+ remove_file(session_path).context("Failed to remove session file")?;
println!("You have logged out!");
} else {
println!("You are not logged in");