aboutsummaryrefslogtreecommitdiffstats
path: root/crates/turtle/src/atuin_client/logout.rs
blob: 2ec41e409c5d7aa9ae35d061f561d064c1d09e31 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use eyre::Result;

use crate::atuin_client::settings::Settings;

pub(crate) async fn logout() -> Result<()> {
    let meta = Settings::meta_store().await?;

    if meta.logged_in().await? {
        meta.delete_session().await?;
        println!("You have logged out!");
    } else {
        println!("You are not logged in");
    }

    Ok(())
}