Skip to content

Instantly share code, notes, and snippets.

@somebehemoth
Created July 3, 2012 18:33
Show Gist options
  • Save somebehemoth/3041681 to your computer and use it in GitHub Desktop.
Save somebehemoth/3041681 to your computer and use it in GitHub Desktop.
#!/bin/bash
# source rvm and .rvmrc if present
[ -s "$HOME/.rvm/scripts/rvm" ] && . "$HOME/.rvm/scripts/rvm"
[ -s "$PWD/.rvmrc" ] && . "$PWD/.rvmrc"
# precompile assets if any have been updated
if git diff-index --name-only HEAD | egrep '^app/assets' >/dev/null ; then
echo 'Precompiling assets...'
rake assets:precompile:all RAILS_ENV=production RAILS_GROUPS=assets
git add public/assets/*
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment