mirror of
https://github.com/jht5945/buildj.git
synced 2025-12-29 18:30:05 +08:00
update match
This commit is contained in:
@@ -57,9 +57,8 @@ pub fn get_cloud_java(version: &str) -> bool {
|
|||||||
};
|
};
|
||||||
for i in 0..cloud_java_names.len() {
|
for i in 0..cloud_java_names.len() {
|
||||||
let cloud_java_name = cloud_java_names[i];
|
let cloud_java_name = cloud_java_names[i];
|
||||||
match tool::get_and_extract_tool_package(&local_java_home_base_dir, false, cloud_java_name, version, false) {
|
if tool::get_and_extract_tool_package(&local_java_home_base_dir, false, cloud_java_name, version, false).is_ok() {
|
||||||
Err(_) => (),
|
return true;
|
||||||
Ok(_) => return true,
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
print_message(MessageType::ERROR, &format!("Get java failed, version: {}", version));
|
print_message(MessageType::ERROR, &format!("Get java failed, version: {}", version));
|
||||||
@@ -73,7 +72,7 @@ pub fn get_macos_java_home(version: &str) -> Option<String> {
|
|||||||
let output = Command::new(MACOS_LIBEXEC_JAVAHOME).arg("-version").arg(version).output().ok()?;
|
let output = Command::new(MACOS_LIBEXEC_JAVAHOME).arg("-version").arg(version).output().ok()?;
|
||||||
if str::from_utf8(&output.stderr).ok()?.contains("Unable to find any JVMs") {
|
if str::from_utf8(&output.stderr).ok()?.contains("Unable to find any JVMs") {
|
||||||
return None;
|
return None;
|
||||||
};
|
}
|
||||||
Some(str::from_utf8(&output.stdout).ok()?.trim().to_string())
|
Some(str::from_utf8(&output.stdout).ok()?.trim().to_string())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user