Skip to content

Instantly share code, notes, and snippets.

@thild
Created October 31, 2017 19:35
Show Gist options
  • Save thild/dc387e50e46698b580dbd2cc7cb95bdc to your computer and use it in GitHub Desktop.
Save thild/dc387e50e46698b580dbd2cc7cb95bdc to your computer and use it in GitHub Desktop.
#!/bin/bash
proxy=http://user:pass@proxy:8080/
if [ "$1" == "off" ]; then
npm config rm proxy
npm config rm https-proxy
git config --global --unset http.proxy
git config --global --unset https.proxy
else
npm config set proxy $proxy
npm config set https-proxy $proxy
git config --global http.proxy $proxy
git config --global https.proxy $proxy
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment