mirror of
https://github.com/jht5945/buildj.git
synced 2025-12-30 02:40:03 +08:00
refactor read_build_json()
This commit is contained in:
10
src/main.rs
10
src/main.rs
@@ -293,7 +293,7 @@ fn process_envs(the_env: &mut HashMap<String, String>, build_json_object: &json:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn read_build_json_object() -> Option<json::JsonValue> {
|
fn read_build_json_object_from_env() -> Option<json::JsonValue> {
|
||||||
if (*JAVA_VERSION).is_some() || (*BUILDER_VERSION).is_some() {
|
if (*JAVA_VERSION).is_some() || (*BUILDER_VERSION).is_some() {
|
||||||
let mut build_json_object = object!{};
|
let mut build_json_object = object!{};
|
||||||
if (*JAVA_VERSION).is_some() {
|
if (*JAVA_VERSION).is_some() {
|
||||||
@@ -320,6 +320,14 @@ fn read_build_json_object() -> Option<json::JsonValue> {
|
|||||||
}
|
}
|
||||||
return Some(build_json_object);
|
return Some(build_json_object);
|
||||||
}
|
}
|
||||||
|
None
|
||||||
|
}
|
||||||
|
|
||||||
|
fn read_build_json_object() -> Option<json::JsonValue> {
|
||||||
|
match read_build_json_object_from_env() {
|
||||||
|
Some(o) => return Some(o),
|
||||||
|
None => (),
|
||||||
|
};
|
||||||
|
|
||||||
let build_json = match find_build_json() {
|
let build_json = match find_build_json() {
|
||||||
None => return None,
|
None => return None,
|
||||||
|
|||||||
Reference in New Issue
Block a user