mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-11-21 14:20:42 +08:00
Simplify the version tauri command
Make it not fail when the build version hasn't been set
This commit is contained in:
@@ -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(),
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user