From 209dcb3e6f50a6289197b4cb3c78e069c327c21e Mon Sep 17 00:00:00 2001 From: Naz Date: Tue, 5 Aug 2025 15:20:26 +0100 Subject: =?UTF-8?q?=F0=9F=90=9Bfix:=20check=20for=20.appimage=20extension?= =?UTF-8?q?=20when=20extracting=20filename=20from=20URL?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/downloader.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/downloader.rs') diff --git a/src/downloader.rs b/src/downloader.rs index f402c4e..b2b46a2 100644 --- a/src/downloader.rs +++ b/src/downloader.rs @@ -14,7 +14,13 @@ impl Downloader { pub fn prepare_path(&self, url: &str, executable: &str) -> Result { // Try to extract filename from URL or use default let filename = match url.split('/').next_back() { - Some(name) => name.to_string(), + Some(name) => { + if name.to_lowercase().ends_with(".appimage") { + name.to_string() + } else { + format!("{executable}.AppImage") + } + } None => format!("{executable}.AppImage"), }; -- cgit v1.2.3