diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/downloader.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/downloader.rs b/src/downloader.rs index c40b0b4..2196e25 100644 --- a/src/downloader.rs +++ b/src/downloader.rs @@ -11,6 +11,15 @@ impl Downloader { pub fn new() -> Self { Self {} } + pub fn prepare_path(&self, url: &str, executable: &str) -> PathBuf { + // Try to extract filename from URL or use default + let filename = match url.split('/').next_back() { + Some(name) => name.to_string(), + None => format!("{executable}.AppImage"), + }; + + appimages_dir().join(filename) + } pub async fn download_with_progress( &self, url: &str, |
