Last active
December 14, 2015 11:58
-
-
Save wildlyinaccurate/5082699 to your computer and use it in GitHub Desktop.
Simple script to run the CoffeeScript and Sass "watch" commands
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/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