Created
October 26, 2012 08:07
-
-
Save andresgutgon/3957558 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="/var/lib/gems/1.8/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