Skip to content

Instantly share code, notes, and snippets.

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 fauxstor/eb761dc867c96060a234 to your computer and use it in GitHub Desktop.
Save fauxstor/eb761dc867c96060a234 to your computer and use it in GitHub Desktop.
#!/bin/bash
COMPASS="/usr/local/rvm/gems/ruby-2.1.5@webui/bin/compass"
case "$1" in
""|start)
echo "Starting compass watch..."
if [ -f ./cwatch.pid ]
then
echo "Sorry, but compass is already watching this folder..."
exit 1
fi
nohup $COMPASS watch > /dev/null 2>/dev/null &
echo $! > ./cwatch.pid
echo "Done."
;;
stop)
echo "Stopping compass watch..."
if [ -f ./cwatch.pid ]
then
xargs kill -9 < ./cwatch.pid
rm ./cwatch.pid
echo "Done."
exit 0
fi
echo "Sorry, but compass is not watching this folder..."
exit 1
;;
*)
echo "Usage: cwatch {start|stop}"
exit 1
;;
esac
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment