mirror of
https://github.com/atuinsh/atuin.git
synced 2025-03-03 01:32:17 +01:00
fix: check session file exists for status command (#1756)
This commit is contained in:
parent
cf2cbd23f0
commit
05857c1c0e
@ -39,6 +39,7 @@ pub enum Cmd {
|
||||
base64: bool,
|
||||
},
|
||||
|
||||
/// Display the sync status
|
||||
Status,
|
||||
}
|
||||
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user