Last active
December 16, 2015 16:39
-
-
Save brettporter/5464167 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 | |
gem_dir=/tmp/gem-grab | |
gem_repo=http://my.gem.repo | |
set -e | |
gem list --source $gem_repo -r -a -u --prerelease | awk '/^[a-z]/' | while read t1 | |
do | |
name=`echo $t1 | perl -n -e '/^([^\s]+)/ && print $1'` | |
echo $t1 | perl -n -e '/\((.*)\)/ && print $1' | tr ',' '\n' | sed 's/^ //' | while read version | |
do | |
echo Fetching $name $version | |
GEM_HOME=$gem_dir gem install --source $gem_repo --no-ri --no-rdoc --ignore-dependencies -v $version $name | |
done | |
done | |
zip -j gems.zip $gem_dir/cache/*.gem |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment