From 857f4a11ea1144cd0a967d56c65508c755da9fc2 Mon Sep 17 00:00:00 2001
From: Andreas Gattringer <andreas.gattringer@univie.ac.at>
Date: Tue, 30 May 2023 16:08:23 +0200
Subject: [PATCH] make filename of downloaded data independent of URL

---
 R/cats_download_helper.R | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/R/cats_download_helper.R b/R/cats_download_helper.R
index d016540..6f65da0 100644
--- a/R/cats_download_helper.R
+++ b/R/cats_download_helper.R
@@ -37,7 +37,7 @@ download_cats_quickstart_data <- function(install.dir, redownload = F, reextract
     newest_version <- data$newest$quickstart_data
     newest_url <-
         subset(data$quickstart_data, version == newest_version)$url
-    destination_file <- file.path(install.dir, basename(newest_url))
+    destination_file <- file.path(install.dir, sprintf("cats-quickstart-data-%s.zip", newest_version))
     if (!file.exists(destination_file) || redownload == TRUE) {
         print(sprintf("Downloading %s to %s", newest_url, destination_file))
         timeout <- R.utils::getOption("timeout")
@@ -100,7 +100,7 @@ download_cats_for_windows <- function(install.dir, redownload = F, reextract = F
     newest_url <-
         subset(data$windows_binaries, version == newest_version)$url
 
-    destination_file <- file.path(install.dir, basename(newest_url))
+    destination_file <- file.path(install.dir, sprintf("cats-%s-windows.zip", newest_version))
     if (!file.exists(destination_file) || redownload == TRUE) {
         print(sprintf("Downloading %s to %s", newest_url, destination_file))
         timeout <- R.utils::getOption("timeout")
-- 
GitLab