handle some networking errors

assume we are up to date if we can't fetch latest version
This commit is contained in:
2024-09-06 11:10:05 +02:00
parent d267d53c49
commit 3963f8fc9b
4 changed files with 30 additions and 13 deletions

View File

@@ -9,7 +9,13 @@ use std::fs;
use std::path::Path;
pub async fn remote_revision() -> u16 {
misc::rev_to_int(&github::latest_tag(GH_IW4X_OWNER, GH_IW4X_REPO).await)
match github::latest_tag(GH_IW4X_OWNER, GH_IW4X_OWNER).await {
Ok(tag) => misc::rev_to_int(&tag),
Err(_) => {
crate::println_error!("Failed to get latest version for {GH_IW4X_OWNER}/{GH_IW4X_OWNER}, assuming we are up to date.");
0
}
}
}
pub async fn update(dir: &Path, cache: &mut structs::Cache) {