bin/drg
#!/bin/bash
if [ "$#" == 0 ]; then
echo "Usage: $0 [ major|minor|patch ]"
echo ""
exit 1
fi
git add Gemfile
for cmd in $@; do
echo " * Updating $cmd versions"
bundle exec rake drg:pin:${cmd}_latest
bundle update
bundle exec rspec . -t ~js
if [ $? -eq 0 ]
then
echo " * Tests passed after updating $cmd versions. Adding Gemfile ..."
git add Gemfile*
else
echo " * Tests failed after updating $cmd versions. Reverting change to Gemfile ..." >&2
git checkout -- Gemfile*
bundle
exit 1
fi
done