mirror of
https://github.com/jht5945/buildj.git
synced 2025-12-28 01:31:35 +08:00
update crates
This commit is contained in:
19
src/misc.rs
19
src/misc.rs
@@ -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"),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user