stop () {
    echo >&2 "$@"
    exit 1
}
[ "$#" -eq 2 ] || stop "2 arguments required 'setup.sh <token> <username>', $# provided"

sudo pip3 install jira
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

echo -e "export GITHUB_TOKEN='${1}' \nexport github_username='${2}' \nsource \$(bazel_root)/qa/tools/automate_test_prs/qarc.sh" >> ~/.bashrc
eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv)

brew install hub
