Created
August 7, 2013 06:57
-
-
Save gheydon/6171813 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
themes_altered=() | |
for config in docroot/sites/*/themes/*/config.rb | |
do | |
theme_dir=`dirname $config` | |
git diff --cached --exit-code $theme_dir/sass/*.scss > /dev/null | |
if [ "$?" -eq 1 ]; then | |
themes_altered+=($theme_dir) | |
# the css is going to be blown away anyway so lets revert it to HEAD | |
git checkout HEAD -- $theme_dir/css | |
fi | |
done | |
if [ "${#themes_altered[@]}" -gt "0" ]; then | |
git stash save --keep-index "Compass recompile" | |
for dir in "${themes_altered[@]}" | |
do | |
/usr/bin/compass compile $dir -e production --boring --force | |
git add $dir/css/*.css $dir/css/*/*.css | |
done | |
git stash pop | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment