Created
September 3, 2013 19:45
-
-
Save DArcMattr/6428630 to your computer and use it in GitHub Desktop.
Assumptions: You are using the SCSS flavor of SASS; even if you don't have SASS installed on the system you're using this on, you have it and compass installed on a machine you have SSH access to. Installation: 1) you *must* create a symbolic link to this in your .git/hooks directory "ln -s /path/to/git/hook/in/source/control /path/to/.git/hooks…
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 | |
# Create a symbolic link to this in the .git/hooks directory | |
theme_path="/absolute/path/to/theme/directory/here" | |
if [ $(git diff HEAD@{1} HEAD --name-only | grep -E 'style.scss' -c) -ne 0 ]; then | |
echo "style.scss changed, compiling" | |
if type "sass" > /dev/null 2>&1; then | |
sass --scss --compass -lC $theme_path/style.scss > $theme_path/style.css; | |
else | |
cat $theme_path/style.scss | ssh XXX@YYY.ZZZ \ | |
"sass --scss --compass --no-cache --style compressed" \ | |
> $theme_path/style.css | |
fi | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment