Skip to content

Instantly share code, notes, and snippets.

@gnarmis
Created August 9, 2011 21:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gnarmis/1135238 to your computer and use it in GitHub Desktop.
Save gnarmis/1135238 to your computer and use it in GitHub Desktop.
Single script to watch and compile both CoffeeScript and Sass files
#!/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