1
0
mirror of https://github.com/jht5945/buildj.git synced 2025-12-28 01:31:35 +08:00

update crates

This commit is contained in:
2019-08-15 07:16:28 +08:00
parent caa5b13a01
commit 096366eb89
2 changed files with 66 additions and 84 deletions

View File

@@ -1,9 +1,9 @@
use std::env;
use rust_util::util_env::*;
lazy_static! {
pub static ref VERBOSE: bool = is_verbose();
pub static ref NOAUTH: bool = is_no_auth();
pub static ref VERBOSE: bool = is_env_on("BUILDJ_VERBOSE");
pub static ref NOAUTH: bool = is_env_on("BUILDJ_NOAUTH");
}
pub fn print_usage() {
@@ -35,16 +35,3 @@ Written by Hatter Jiang
"#, super::BUDERJ_VER, &super::GIT_HASH[0..7]);
}
pub fn is_verbose() -> bool {
match env::var("BUILDJ_VERBOSE") {
Err(_) => false,
Ok(v) => (v == "TRUE" || v == "true" || v =="YES" || v == "yes" || v == "1"),
}
}
pub fn is_no_auth() -> bool {
match env::var("BUILDJ_NOAUTH") {
Err(_) => false,
Ok(v) => (v == "TRUE" || v == "true" || v =="YES" || v == "yes" || v == "1"),
}
}