From 2f7bc51feb92082ebc21113cef59e55ef738c04f Mon Sep 17 00:00:00 2001 From: crschnick Date: Thu, 20 Nov 2025 16:21:46 +0000 Subject: [PATCH] Fix download rename with dashes for #721 --- .../main/java/io/xpipe/app/update/AppDownloads.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/io/xpipe/app/update/AppDownloads.java b/app/src/main/java/io/xpipe/app/update/AppDownloads.java index 494cc837d..dc411908b 100644 --- a/app/src/main/java/io/xpipe/app/update/AppDownloads.java +++ b/app/src/main/java/io/xpipe/app/update/AppDownloads.java @@ -35,18 +35,17 @@ public class AppDownloads { throw new IOException(new String(response.body(), StandardCharsets.UTF_8)); } - var downloadFile = AppSystemInfo.ofCurrent().getTemp().resolve(release.getFile()); - // Fix file name to not be included in temp dir clean - var fixedFile = Path.of(downloadFile.toString().replaceAll("-", "_")); - Files.write(fixedFile, response.body()); + // Fix file name to not have dashes to not be included in temp dir clean + var downloadFile = AppSystemInfo.ofCurrent().getTemp().resolve(release.getFile().replaceAll("-", "_")); + Files.write(downloadFile, response.body()); TrackEvent.withInfo("Downloaded asset") .tag("version", version) .tag("url", release.getUrl()) .tag("size", FileUtils.byteCountToDisplaySize(response.body().length)) - .tag("target", fixedFile) + .tag("target", downloadFile) .handle(); - return fixedFile; + return downloadFile; } catch (IOException ex) { // All sorts of things can go wrong when downloading, this is expected ErrorEventFactory.expected(ex);