diff options
| author | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2026-06-12 01:54:21 +0200 |
|---|---|---|
| committer | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2026-06-12 01:54:21 +0200 |
| commit | bbdf38018b47328b5faa2cef635c37095045be72 (patch) | |
| tree | 8983817d547551ae12508a8ae8731b622d990af4 /crates/turtle/src/command/client/sync/status.rs | |
| parent | feat(server): Make user stuff stateless (diff) | |
| download | atuin-bbdf38018b47328b5faa2cef635c37095045be72.zip | |
feat(server): Really make users stateless (with tests)
This commit also remove another load of unneeded features.
Diffstat (limited to 'crates/turtle/src/command/client/sync/status.rs')
| -rw-r--r-- | crates/turtle/src/command/client/sync/status.rs | 34 |
1 files changed, 11 insertions, 23 deletions
diff --git a/crates/turtle/src/command/client/sync/status.rs b/crates/turtle/src/command/client/sync/status.rs index 27b10dbd..e75171eb 100644 --- a/crates/turtle/src/command/client/sync/status.rs +++ b/crates/turtle/src/command/client/sync/status.rs @@ -1,36 +1,24 @@ -use crate::atuin_client::{api_client, settings::Settings}; +use crate::atuin_client::settings::Settings; use crate::{SHA, VERSION}; use colored::Colorize; use eyre::{Result, bail}; pub(crate) async fn run(settings: &Settings) -> Result<()> { - if !settings.have_sync_key().await? { - bail!("You are not logged in to a sync server - cannot show sync status"); - } - - let client = api_client::Client::new( - &settings.sync_address, - settings.sync_auth().await?.into_auth_token()?, - settings.network_connect_timeout, - settings.network_timeout, - )?; - - let me = client.me().await?; - let last_sync = Settings::last_sync().await?; + if let Some(me) = settings.sync.user_id()? { + let last_sync = Settings::last_sync().await?; - println!("Atuin v{VERSION} - Build rev {SHA}\n"); + println!("Atuin v{VERSION} - Build rev {SHA}\n"); - println!("{}", "[Local]".green()); - - if settings.auto_sync { - println!("Sync frequency: {}", settings.sync_frequency); + println!("{}", "[Local]".green()); + println!("Sync frequency: {}", settings.sync.frequency); println!("Last sync: {}", last_sync.to_offset(settings.timezone.0)); - } + println!("Auto sync: {}", settings.sync.auto); - if settings.auto_sync { println!("{}", "[Remote]".green()); - println!("Address: {}", settings.sync_address); - println!("Username: {}", me.username); + println!("Address: {}", settings.sync.address); + println!("User id: {}", me); + } else { + bail!("You are not logged in to a sync server - cannot show sync status"); } Ok(()) |
