diff --git a/atuin/src/command/client/sync.rs b/atuin/src/command/client/sync.rs index 67840ced..03735eb5 100644 --- a/atuin/src/command/client/sync.rs +++ b/atuin/src/command/client/sync.rs @@ -39,6 +39,7 @@ pub enum Cmd { base64: bool, }, + /// Display the sync status Status, } diff --git a/atuin/src/command/client/sync/status.rs b/atuin/src/command/client/sync/status.rs index a03ebb4c..b7b63c22 100644 --- a/atuin/src/command/client/sync/status.rs +++ b/atuin/src/command/client/sync/status.rs @@ -1,9 +1,19 @@ +use std::path::PathBuf; + use crate::{SHA, VERSION}; use atuin_client::{api_client, database::Database, settings::Settings}; use colored::Colorize; use eyre::Result; pub async fn run(settings: &Settings, db: &impl Database) -> Result<()> { + let session_path = settings.session_path.as_str(); + + if !PathBuf::from(session_path).exists() { + println!("You are not logged in to a sync server - cannot show sync status"); + + return Ok(()); + } + let client = api_client::Client::new( &settings.sync_address, &settings.session_token,