Forked from andresgutgon/compass-watch-in-background.sh
Last active
August 29, 2015 14:11
-
-
Save fauxstor/eb761dc867c96060a234 to your computer and use it in GitHub Desktop.
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 | |
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