diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/launcher/jre.rs | 9 | ||||
| -rw-r--r-- | src/util.rs | 4 |
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 |
