Created
July 1, 2014 13:22
-
-
Save tangzhen/b1149a71a3ffcd05e3cd to your computer and use it in GitHub Desktop.
Cleanup all gem sets
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 | |
echo "NB! This process could be too destructive sometimes and you may need to run 'bundle' command from your project directory." | |
echo "Do you want to cleanup all gemsets?" | |
read -p "(anything other than 'yes' will cancel) > " ANSWER | |
if [[ $ANSWER != "yes" ]] | |
then | |
echo "Phew...\nMay be another day." | |
else | |
for gemset in `ls $rvm_path/gems | grep @` | |
do | |
echo "Switching to gemset $gemset" | |
rvm $gemset do gem cleanup | |
done | |
echo "\nAll gemsets are clean and shiny!" | |
fi | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment