Proxy switchy script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
|if [[ -z "$1" ]]; then|
|echo "Usage: proxy_switch.sh en 22.214.171.124:8080.|
|if [[ "$1" == "en" ]]; then|
|git config --global http.proxy $2|
|npm config set proxy http://$2|
|npm config set https-proxy http://$2|
|elif [[ "$1" == "dis" ]]; then|
|git config --global http.proxy ""|
|npm config delete proxy|
|npm config delete https-proxy|
Dec 17, 2014
export / unset depends upon the shell youre using. I'm on the iterm2 default and export worked but unset didn't.
Feb 13, 2015
Unusually, in my case (I'm using zsh btw) setting the variables to empty doesn't work though, so we maybe need something else.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
The disabling of shell proxies didn't work for me recently.
Instead of setting the variables to empty, I think we need to use 'unset'.