Last active
December 14, 2015 17:08
-
-
Save djanowski/5119590 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 | |
# Assuming you use gs(1) and dep(1), this program | |
# implodes your .gs directory and installs all gems | |
# listed in your .gems file with a single call to gem(1). | |
# | |
# gs(1): https://github.com/soveran/gs | |
# dep(1): https://github.com/cyx/dep | |
set -e | |
die() { | |
echo "$@" >&2 | |
exit 1 | |
} | |
[[ -f .gems ]] || die "No .gems file found. Are you sure you're in the right directory?" | |
[[ -d .gs ]] && rm -r .gs | |
mkdir .gs | |
if gem -v | grep -q '^2\.'; then | |
specs=$(sed -e 's/ -v /:/' .gems) | |
else | |
specs=$(cat .gems) | |
fi | |
specs=$(tr "\n" " " <<< $specs) | |
echo " gem install $specs" | |
gs "gem install $specs" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment