Skip to content

Instantly share code, notes, and snippets.

@jonuts
Created July 8, 2010 20:22
Show Gist options
  • Save jonuts/468559 to your computer and use it in GitHub Desktop.
Save jonuts/468559 to your computer and use it in GitHub Desktop.
#!/bin/sh
GEMFILE_REPO=../drive-gemfile
cat <<EOM
***************************
* UPDATING GEMFILE REPO *
* for rubytracker.com *
***************************
EOM
test -f Gemfile && test -f Gemfile.lock || {
echo This repo is not bundled!
exit
}
git branch | grep --color=never "* master" || {
echo Not on master. Exiting.
exit
}
test -d $GEMFILE_REPO && test -d $GEMFILE_REPO/.git || {
echo $GEMFILE_REPO does not exist or is not a git repo. Exiting.
exit
}
cp Gemfile Gemfile.lock $GEMFILE_REPO
cd $GEMFILE_REPO
test `git diff | wc -l` -gt 0 || {
echo Gemfile is up to date
exit
}
git commit -am"AUTO-GEMFILE-UPDATE - `date`"
git push origin master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment