diff options
| author | 2026-03-18 11:51:24 +0800 | |
|---|---|---|
| committer | 2026-03-18 11:51:24 +0800 | |
| commit | 983c1dabd044d908540cbbdbc2c8d22cc36f5a82 (patch) | |
| tree | 170af33437ea80933d2aed37fde90cfef7a91da1 | |
| parent | 08bcd364e5f32be457263f665797c2301379efb9 (diff) | |
| download | DropOut-983c1dabd044d908540cbbdbc2c8d22cc36f5a82.tar.gz DropOut-983c1dabd044d908540cbbdbc2c8d22cc36f5a82.zip | |
Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
| -rw-r--r-- | src-tauri/src/main.rs | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index e7deee7..9d4d17c 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -99,12 +99,17 @@ fn has_unresolved_placeholder(s: &str) -> bool { } fn resolve_minecraft_version(version_id: &str) -> String { - if version_id.starts_with("fabric-loader-") { - version_id - .split('-') - .next_back() - .unwrap_or(version_id) - .to_string() + if let Some(rest) = version_id.strip_prefix("fabric-loader-") { + // Fabric version IDs are of the form: fabric-loader-<loader>-<mc> + // After stripping the prefix, we split once to separate loader vs mc + let mut parts = rest.splitn(2, '-'); + let _loader_version = parts.next(); + if let Some(mc_version) = parts.next() { + mc_version.to_string() + } else { + // Malformed Fabric ID, fall back to original + version_id.to_string() + } } else if version_id.contains("-forge-") { version_id .split("-forge-") |