Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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…
#!/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
You can’t perform that action at this time.