From 0cfd75327907145511423940a0e58394e5a0e9e0 Mon Sep 17 00:00:00 2001 From: lgou2w Date: Fri, 19 May 2023 19:34:33 +0800 Subject: [PATCH] fix: the get_version command has no date --- src-tauri/src/commands.rs | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src-tauri/src/commands.rs b/src-tauri/src/commands.rs index 4179e0a..d3c010f 100644 --- a/src-tauri/src/commands.rs +++ b/src-tauri/src/commands.rs @@ -11,14 +11,15 @@ pub fn get_handlers() -> Box) + Send + Sync> { #[tauri::command] fn get_version() -> String { + let date = constants::COMMIT_DATE.split('T').collect::>()[0]; let commit_tag = constants::COMMIT_TAG; if !commit_tag.is_empty() && commit_tag.to_lowercase().contains("snapshot") { - return commit_tag.to_owned() + format!("{} ({})", commit_tag, date) + } else { + format!("{}-{} ({})", + constants::VERSION, + constants::COMMIT_HASH[0..7].to_owned(), + date + ) } - - format!("{}-{} ({})", - constants::VERSION, - constants::COMMIT_HASH[0..7].to_owned(), - constants::COMMIT_DATE.split('T').collect::>()[0] - ) }