Skip to content

Instantly share code, notes, and snippets.

@wildlyinaccurate
Last active December 14, 2015 11:58
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wildlyinaccurate/5082699 to your computer and use it in GitHub Desktop.
Save wildlyinaccurate/5082699 to your computer and use it in GitHub Desktop.
Simple script to run the CoffeeScript and Sass "watch" commands
#!/bin/bash
PIDFILE=".watch.pid"
touch $PIDFILE || (echo "Unable to write to .watch.pid" && exit 1)
# Kill off old processes
while read pid; do
kill $pid
done < $PIDFILE
# Truncate the PID file
> $PIDFILE
# Store the PID of coffee and sass watch processes
coffee -o app/js/ -cw src/coffee/ > ./coffee-compile.log 2>&1 &
echo $! >> $PIDFILE
sass --watch src/sass:app/css > ./sass-compile.log 2>&1 &
echo $! >> $PIDFILE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment