1
0
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:
2019-08-23 23:58:55 +08:00
parent 689422921f
commit 0fc67544b2
2 changed files with 4 additions and 5 deletions

View File

@@ -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 {

View File

@@ -75,9 +75,10 @@ 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> {