Created
August 3, 2017 22:21
-
-
Save kcowgill/23c4337e86b10b5f333081bbc636218e 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 | |
for FILE in `ls *.tgz`; do | |
echo "Unzipping '$FILE'" | |
tar xzf $FILE | |
cd package/ | |
echo "Checking for old repo..." | |
perl -pi -e 's/https.*/http:\/\/new.repository\/repository\/custom-npm\/"/ if m/registry.*https:\/\/package/' package.json | |
echo "Uploading to new repo..." | |
npm publish --registry=http://new.repository/repository/custom-npm/ | |
cd .. | |
rm -rf package | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment