Bump Theseus Version (#818)

* push to test on windows

* Fix windows sup

* Fix macos

* Fix back

* new resolver for windows testing

* Custom macos handling for some versions

* Fix 1.13+ broken

* fix arg parsing mac

* small winblows fix

* remove debug info; set meta url

* run lint + fix clippy

* Remove useless commnet
This commit is contained in:
Geometrically
2023-10-21 13:08:47 -07:00
committed by GitHub
parent 7fb8850071
commit afaec4b1bf
27 changed files with 189 additions and 97 deletions

View File

@@ -43,7 +43,9 @@ pub async fn get_all_jre() -> Result<Vec<JavaVersion>, JREError> {
r"C:\Program Files (x86)\Eclipse Adoptium",
];
for java_path in java_paths {
let Ok(java_subpaths) = std::fs::read_dir(java_path) else {continue };
let Ok(java_subpaths) = std::fs::read_dir(java_path) else {
continue;
};
for java_subpath in java_subpaths.flatten() {
let path = java_subpath.path();
jre_paths.insert(path.join("bin"));
@@ -97,7 +99,7 @@ pub fn get_paths_from_jre_winregkey(jre_key: RegKey) -> HashSet<PathBuf> {
for subkey_value in subkey_value_names {
let path: Result<String, std::io::Error> =
subkey.get_value(subkey_value);
let Ok(path) = path else {continue};
let Ok(path) = path else { continue };
jre_paths.insert(PathBuf::from(path).join("bin"));
}
@@ -264,7 +266,9 @@ pub async fn check_java_at_filepaths(
pub async fn check_java_at_filepath(path: &Path) -> Option<JavaVersion> {
// Attempt to canonicalize the potential java filepath
// If it fails, this path does not exist and None is returned (no Java here)
let Ok(path) = io::canonicalize(path) else { return None };
let Ok(path) = io::canonicalize(path) else {
return None;
};
// Checks for existence of Java at this filepath
// Adds JAVA_BIN to the end of the path if it is not already there

View File

@@ -56,7 +56,12 @@ pub const ARCH_WIDTH: &str = "64";
pub const ARCH_WIDTH: &str = "32";
// Platform rule handling
pub fn os_rule(rule: &OsRule, java_arch: &str) -> bool {
pub fn os_rule(
rule: &OsRule,
java_arch: &str,
// Minecraft updated over 1.18.2 (supports MacOS Natively)
minecraft_updated: bool,
) -> bool {
let mut rule_match = true;
if let Some(ref arch) = rule.arch {
@@ -64,8 +69,14 @@ pub fn os_rule(rule: &OsRule, java_arch: &str) -> bool {
}
if let Some(name) = &rule.name {
rule_match &=
&Os::native() == name || &Os::native_arch(java_arch) == name;
if minecraft_updated
&& (name != &Os::LinuxArm64 || name != &Os::LinuxArm32)
{
rule_match &=
&Os::native() == name || &Os::native_arch(java_arch) == name;
} else {
rule_match &= &Os::native_arch(java_arch) == name;
}
}
if let Some(version) = &rule.version {