From 2ae7b65674b87b3ab5ad2885edd4a77406f2165c Mon Sep 17 00:00:00 2001 From: Sebastian Martinez Date: Wed, 7 May 2025 16:33:32 +0200 Subject: [PATCH] Simplify the version tauri command Make it not fail when the build version hasn't been set --- crates/radicle-tauri/src/commands/startup.rs | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/crates/radicle-tauri/src/commands/startup.rs b/crates/radicle-tauri/src/commands/startup.rs index 0ea8b3d62..79de2f4ce 100644 --- a/crates/radicle-tauri/src/commands/startup.rs +++ b/crates/radicle-tauri/src/commands/startup.rs @@ -29,16 +29,9 @@ impl Serialize for Version { #[tauri::command] pub(crate) fn version(app: AppHandle) -> Result { - let version = app - .config() - .version - .clone() - .expect("The build version has not been set."); - pub const GIT_HEAD: &str = env!("GIT_HEAD"); - Ok(Version { - version, - head: GIT_HEAD.to_string(), + version: app.config().version.clone().unwrap_or("unknown".into()), + head: env!("GIT_HEAD").to_string(), }) }