Last active
July 20, 2016 04:36
-
-
Save branning/746aaade9fdda997a93e5772b578702c to your computer and use it in GitHub Desktop.
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
#!/bin/bash | |
# | |
# alias for npm that only uses git over https | |
set -o errexit # exit on any error | |
real_npm=`which npm` | |
npm_install() | |
{ | |
# quit if we can't find 'packages.json' | |
! [ -f packages.json ] && { echo "`basename $0`: cannot find package.json"; exit 1; } | |
# rewrite 'git@github.com:' ssh urls to 'https://github.com/' | |
sed 's|git@github\.com:|https://github.com/|' package.json > package_https.json | |
$real_npm install package_https.json | |
} | |
case "$1" in | |
install) npm_install $@ ;; | |
*) $real_npm $@ | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment