summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLibravatar bigfoot547 <[email protected]>2025-01-23 15:29:34 -0600
committerLibravatar bigfoot547 <[email protected]>2025-01-23 15:29:34 -0600
commit075bee27ee6f9fe277a9f08e787d2cc607aaebd5 (patch)
treef2fcfae7faa6f0b8c625a23222551fc473a01257 /src
parentfix neoforge regression (diff)
fix jre cleanup on windows
Diffstat (limited to 'src')
-rw-r--r--src/launcher/jre.rs9
-rw-r--r--src/util.rs4
2 files changed, 10 insertions, 3 deletions
diff --git a/src/launcher/jre.rs b/src/launcher/jre.rs
index a09c8f3..a3cbb27 100644
--- a/src/launcher/jre.rs
+++ b/src/launcher/jre.rs
@@ -110,7 +110,14 @@ impl JavaRuntimeRepository {
continue;
}
- if !rel_path.to_str().is_some_and(|s| manifest.files.get(s)
+ let rel_path_str;
+ if std::path::MAIN_SEPARATOR != '/' {
+ rel_path_str = rel_path.to_str().map(|s| s.replace(std::path::MAIN_SEPARATOR, "/"));
+ } else {
+ rel_path_str = rel_path.to_str().map(String::from);
+ }
+
+ if !rel_path_str.as_ref().is_some_and(|s| manifest.files.get(s)
.is_some_and(|f| (f.is_file() == entry.file_type().is_file())
|| (f.is_directory() == entry.file_type().is_dir())
|| (f.is_link() == entry.file_type().is_symlink()))) {
diff --git a/src/util.rs b/src/util.rs
index 5ea0f26..0685848 100644
--- a/src/util.rs
+++ b/src/util.rs
@@ -164,8 +164,8 @@ pub async fn should_download(path: impl AsRef<Path>, expect_size: Option<usize>,
debug!("File {} is missing, downloading it.", path.display());
Ok(true)
},
- Err(FileVerifyError::Integrity(_, e)) => {
- warn!("Integrity error on file: {}", e);
+ Err(FileVerifyError::Integrity(p, e)) => {
+ warn!("Integrity error on file {}: {}", p.display(), e);
// try to delete the file since it's bad
let _ = fs::remove_file(path).await