git-brws 0.9.1

Command line tool to open a repository, file, commit or diff in your web browser from command line
use crate::env::Env;
use std::env;

pub fn empty_env() -> Env {
    Env {
        git_command: "git".to_string(),
        ghe_ssh_port: None,
        ghe_url_host: None,
        gitlab_ssh_port: None,
        github_token: None,
        ghe_token: None,
        https_proxy: None,
    }
}

pub fn https_proxy() -> Option<String> {
    env::var("https_proxy")
        .or_else(|_| env::var("HTTPS_PROXY"))
        .ok()
}

macro_rules! skip_if_no_token {
    () => {
        match ::std::env::var("GIT_BRWS_GITHUB_TOKEN").or_else(|_| ::std::env::var("GITHUB_TOKEN"))
        {
            Ok(ref v) if v == "" => return,
            Ok(v) => Some(v),
            Err(_) => return,
        }
    };
}