Created
August 9, 2011 21:23
-
-
Save gnarmis/1135238 to your computer and use it in GitHub Desktop.
Single script to watch and compile both CoffeeScript and Sass files
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/bash | |
# run `compass watch` at pwd | |
# run `coffee -o scripts/ -cw coffee/` at pwd | |
type -P compass &>/dev/null || { echo "Compass command not found."; exit 1; } | |
type -P coffee &>/dev/null || { echo "Coffee command not found."; exit 1; } | |
if [ ! -d sass/ ] || [ ! -d scripts/ ] | |
then | |
echo "Project not setup correctly! Put sass files in sass/ and coffee in coffee/" | |
else | |
if [ ! -d stylesheets/ ] | |
then | |
mkdir stylesheets | |
fi | |
if [ ! -d scripts/ ] | |
then | |
mkdir scripts | |
fi | |
echo "Watching changes in sass/ and coffee/ and compiling to stylesheets/ and scripts/ ..." | |
`compass watch --quiet` & | |
`coffee -o scripts/ -cw coffee/` & | |
wait | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment