Simplify the version tauri command

Make it not fail when the build version hasn't been set
This commit is contained in:
Sebastian Martinez
2025-05-08 13:38:43 +02:00
parent ff13c1e4f3
commit 2ae7b65674
+2 -9
View File
@@ -29,16 +29,9 @@ impl Serialize for Version {
#[tauri::command]
pub(crate) fn version(app: AppHandle) -> Result<Version, Error> {
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(),
})
}