Skip to content

Instantly share code, notes, and snippets.

@ivzhao
Created June 20, 2011 16:26
Show Gist options
  • Save ivzhao/1035933 to your computer and use it in GitHub Desktop.
Save ivzhao/1035933 to your computer and use it in GitHub Desktop.
bash script for watching and recompiling node.js, and coffeescripts in multiple directories.
#!/bin/bash
# Usage: "./start.sh -e" to start watching the compass and coffeescripts changes,
# "./start.sh -s" to start node.js and restart server whenever the code changes.
trap 'kill $(jobs -p)' SIGUSR1
function startEnviroment {
echo 'Start Developing Enviroment'
compass watch ./static/style &
coffee --watch --compile *.coffee &
coffee --watch --compile ./static/script/*.coffee &
}
function startServer {
supervisor -w . app.coffee &
}
for arg in "$@"
do
case "$arg" in
-e) startEnviroment
;;
-s) startServer
;;
esac
done
while true; do sleep 2; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment