pub struct EnvVars;
impl EnvVars {
pub const HX_CONFIG_FILE: &'static str = "HX_CONFIG_FILE";
pub const HX_CACHE_DIR: &'static str = "HX_CACHE_DIR";
pub const HX_VERBOSE: &'static str = "HX_VERBOSE";
pub const HX_QUIET: &'static str = "HX_QUIET";
pub const HX_NO_COLOR: &'static str = "HX_NO_COLOR";
pub const HX_COLOR: &'static str = "HX_COLOR";
pub const HX_LOG_JSON: &'static str = "HX_LOG_JSON";
pub const HX_GHC: &'static str = "HX_GHC";
pub const HX_CABAL: &'static str = "HX_CABAL";
pub const HX_GHCUP: &'static str = "HX_GHCUP";
pub const HX_HLS: &'static str = "HX_HLS";
pub const HX_GHC_VERSION: &'static str = "HX_GHC_VERSION";
pub const HX_JOBS: &'static str = "HX_JOBS";
pub const HX_RELEASE: &'static str = "HX_RELEASE";
pub const HX_FORMATTER: &'static str = "HX_FORMATTER";
pub const NO_COLOR: &'static str = "NO_COLOR";
pub const CLICOLOR: &'static str = "CLICOLOR";
pub const CI: &'static str = "CI";
pub const JPY_SESSION_NAME: &'static str = "JPY_SESSION_NAME";
pub const HOME: &'static str = "HOME";
}
pub fn is_ci() -> bool {
std::env::var(EnvVars::CI).is_ok()
}
pub fn is_jupyter() -> bool {
std::env::var(EnvVars::JPY_SESSION_NAME).is_ok()
}
pub fn no_color() -> bool {
std::env::var(EnvVars::NO_COLOR).is_ok()
|| std::env::var(EnvVars::HX_NO_COLOR).is_ok()
|| std::env::var(EnvVars::CLICOLOR)
.map(|v| v == "0")
.unwrap_or(false)
}