From 757aad43a1be06718a748c4c9a69404b8510203c Mon Sep 17 00:00:00 2001 From: mxve <68632137+mxve@users.noreply.github.com> Date: Fri, 30 Aug 2024 08:42:59 +0200 Subject: [PATCH] keep .iw4xrevision used by iw4x to determine if update is available --- src/iw4x.rs | 2 ++ src/main.rs | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/iw4x.rs b/src/iw4x.rs index 0fa52aa..6832312 100644 --- a/src/iw4x.rs +++ b/src/iw4x.rs @@ -4,6 +4,7 @@ use crate::http_async; use crate::misc; use crate::structs; +use std::fs; use std::path::Path; pub async fn remote_revision() -> u16 { @@ -36,4 +37,5 @@ pub async fn update(dir: &Path, cache: &mut structs::Cache) { .unwrap(); cache.iw4x_revision = format!("r{remote}"); + fs::write(dir.join(".iw4xrevision"), &cache.iw4x_revision).unwrap(); } diff --git a/src/main.rs b/src/main.rs index 2fa3c71..02b037e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -324,7 +324,7 @@ async fn update( std::process::exit(0); } - let old_files = [".sha-sums", ".iw4xrevision"]; + let old_files = [".sha-sums"]; for f in old_files { if dir.join(f).exists() { match fs::remove_file(dir.join(f)) {