mirror of
https://github.com/spacebarchat/client.git
synced 2025-01-31 19:41:37 +01:00
custom update version comparison
This commit is contained in:
parent
869e745fb0
commit
c7b7cf4cb7
@ -7,8 +7,8 @@ import process from "process";
|
||||
// process.exit(0);
|
||||
// }
|
||||
|
||||
const GITHUB_RUN_ID = process.env.GITHUB_RUN_ID;
|
||||
const GITHUB_RUN_ATTEMPT = process.env.GITHUB_RUN_ATTEMPT;
|
||||
const GITHUB_RUN_ID = process.env.GITHUB_RUN_ID || "0";
|
||||
const GITHUB_RUN_ATTEMPT = process.env.GITHUB_RUN_ATTEMPT || "0";
|
||||
const GITHUB_REF_NAME = process.env.GITHUB_REF_NAME;
|
||||
|
||||
const pkgJsonPath = path.resolve("./package.json");
|
||||
|
@ -33,8 +33,6 @@ pub fn check_for_updates<R: Runtime>(ignore_prereleases: bool, window: tauri::Wi
|
||||
return;
|
||||
}
|
||||
|
||||
println!("Current version: {}", handle.package_info().version);
|
||||
|
||||
tauri::async_runtime::spawn(async move {
|
||||
println!("Searching for update file on github.");
|
||||
// Custom configure the updater.
|
||||
@ -125,7 +123,18 @@ pub fn check_for_updates<R: Runtime>(ignore_prereleases: bool, window: tauri::Wi
|
||||
.version_comparator(|current_version, latest_version| {
|
||||
println!("Current version: {}", current_version);
|
||||
println!("Latest version: {}", latest_version.version.clone());
|
||||
false
|
||||
|
||||
if latest_version.version > current_version {
|
||||
println!("Latest version is greater than current version. ");
|
||||
return true;
|
||||
}
|
||||
|
||||
if latest_version.version < current_version {
|
||||
println!("Latest version is lower than current version. ");
|
||||
return false;
|
||||
}
|
||||
|
||||
return latest_version.version.build > current_version.build;
|
||||
})
|
||||
.endpoints(vec![tauri_release_endpoint])
|
||||
.header("User-Agent", "spacebar-client")
|
||||
|
Loading…
x
Reference in New Issue
Block a user