// SPDX-FileCopyrightText: 2026 Contributors to brew-proxy <https://codeberg.org/HastD/brew-proxy>
//
// SPDX-License-Identifier: Apache-2.0 OR MIT

pub const ENV_VAR_NO_PROXY: &str = "NO_BREW_PROXY";
pub const ENV_VAR_NONINTERACTIVE: &str = "BREW_PROXY_NONINTERACTIVE";
pub const ENV_VAR_TEST_PIPED: &str = "BREW_PROXY_TEST_PIPED";
pub const ENV_VAR_TEST_STDIN: &str = "BREW_PROXY_TEST_STDIN";

pub fn env_var_set(var: &str) -> bool {
    std::env::var(var).is_ok_and(|s| !["", "0", "false", "off"].contains(&&*s.to_lowercase()))
}
