diff --git a/src/main.rs b/src/main.rs index 98752c6..bb9a8cf 100644 --- a/src/main.rs +++ b/src/main.rs @@ -3,11 +3,11 @@ use std::path::PathBuf; use filetime::FileTime; use glob::glob; -use log::{debug, error, info, LevelFilter}; +use log::{debug, error, info, LevelFilter, warn}; use ratatui::backend::CrosstermBackend; use ratatui::Terminal; use regex::Regex; -use self_update::{cargo_crate_version, Status}; +use self_update::{Status}; use crate::app::{App, AppResult}; use crate::config::{get_config, get_logdir}; @@ -80,10 +80,15 @@ fn main() -> AppResult<()> { } Ok(UpdateResult::UpToDate) => {} Err(e) => { - error!("Failed to update the application. {}", e); - tui_logger::move_events(); - println!("Failed to update the application."); - return Err(e.into()); + if matches!(e, UpdateError::NoCompatibleAssetFound) { + warn!("Current release has no asset for current target."); + tui_logger::move_events(); + } else { + error!("Failed to update the application. {}", e); + tui_logger::move_events(); + println!("Failed to update the application."); + return Err(e.into()); + } } } } diff --git a/src/update.rs b/src/update.rs index 50bdf90..386d3fe 100644 --- a/src/update.rs +++ b/src/update.rs @@ -4,8 +4,8 @@ use log::{debug, error, info}; use self_update::{cargo_crate_version, Extract, self_replace}; use semver::Version; use snafu::Snafu; -use crate::app::AppResult; +#[derive(Debug, PartialEq)] pub enum UpdateResult { UpToDate, Updated,