Created
February 5, 2016 22:11
-
-
Save jamiebuilds/eba3a918a3db80ddc656 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/sh | |
set -e | |
read -p "Username: " username | |
read -p "Are you sure you want to add $username to all packages (y/n)? " confirm | |
if [ "$confirm" != "y" ]; then | |
echo "Ok bye." | |
exit 0 | |
fi | |
for f in packages/*; do | |
package=`basename $f` | |
if [ -d "$f" ] && [ -e "$f/package.json" ]; then | |
npm owner add $username $package | |
fi | |
done | |
echo "$username" >> NPM_OWNERS | |
echo "Success." |
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/sh | |
set -e | |
read -p "Username: " username | |
read -p "Are you sure you want to remove $username from all packages (y/n)? " confirm | |
if [ "$confirm" != "y" ]; then | |
echo "Ok bye." | |
exit 0 | |
fi | |
for f in packages/*; do | |
package=`basename $f` | |
if [ -d "$f" ] && [ -e "$f/package.json" ]; then | |
npm owner rm $username $package | |
fi | |
done | |
sed -i '' "/$username/d" NPM_OWNERS | |
echo "Success." |
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/sh | |
set -e | |
cat NPM_OWNERS | |
read -p "Do you want to add the above owners to all packages (y/n)? " confirm | |
if [ "$confirm" != "y" ]; then | |
echo "Ok bye." | |
exit 0 | |
fi | |
while read username | |
do | |
for f in packages/*; do | |
package=`basename $f` | |
if [ -d "$f" ] && [ -e "$f/package.json" ]; then | |
echo "Adding $username to $package." | |
npm owner add $username $package | |
fi | |
done | |
done < NPM_OWNERS | |
echo "Success." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment