1
0
mirror of https://github.com/jht5945/buildj.git synced 2025-12-29 02:10:04 +08:00

refactor read_build_json()

This commit is contained in:
2019-09-24 23:59:55 +08:00
parent 1a80241084
commit 0b93536d23

View File

@@ -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() {
let mut build_json_object = object!{};
if (*JAVA_VERSION).is_some() {
@@ -320,6 +320,14 @@ fn read_build_json_object() -> Option<json::JsonValue> {
}
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() {
None => return None,