mirror of
https://github.com/jht5945/buildj.git
synced 2025-12-29 18:30:05 +08:00
update if else
This commit is contained in:
@@ -11,9 +11,7 @@ use rust_util::{
|
|||||||
XResult,
|
XResult,
|
||||||
};
|
};
|
||||||
|
|
||||||
use super::misc::{
|
use super::misc::VERBOSE;
|
||||||
VERBOSE,
|
|
||||||
};
|
|
||||||
|
|
||||||
pub fn download_url(url: &str, dest: &mut File) -> XResult<()> {
|
pub fn download_url(url: &str, dest: &mut File) -> XResult<()> {
|
||||||
if *VERBOSE {
|
if *VERBOSE {
|
||||||
|
|||||||
@@ -75,10 +75,11 @@ pub fn get_macos_java_home(version: &str) -> Option<String> {
|
|||||||
print_message(MessageType::DEBUG, &format!("java_home outputs: {}", output_in_utf8));
|
print_message(MessageType::DEBUG, &format!("java_home outputs: {}", output_in_utf8));
|
||||||
}
|
}
|
||||||
if output_in_utf8.contains("Unable to find any JVMs") {
|
if output_in_utf8.contains("Unable to find any JVMs") {
|
||||||
return None;
|
None
|
||||||
}
|
} else {
|
||||||
Some(str::from_utf8(&output.stdout).ok()?.trim().to_string())
|
Some(str::from_utf8(&output.stdout).ok()?.trim().to_string())
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pub fn get_local_java_home(version: &str) -> Option<String> {
|
pub fn get_local_java_home(version: &str) -> Option<String> {
|
||||||
let local_java_home_base_dir = local_util::get_user_home_dir(LOCAL_JAVA_HOME_BASE_DIR).ok()?;
|
let local_java_home_base_dir = local_util::get_user_home_dir(LOCAL_JAVA_HOME_BASE_DIR).ok()?;
|
||||||
|
|||||||
Reference in New Issue
Block a user