-
-
Save gnps/35f9950ca376fdf15cc6 to your computer and use it in GitHub Desktop.
This file contains hidden or 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/sh | |
# ================================================ | |
# Description: Run compass watch in background | |
# GistID: 965f3e1a0876592db33f | |
# GistURL https://gist.github.com/allex/965f3e1a0876592db33f | |
# Author: Allex Wang ([email protected]) | |
# Last Modified: Tue Dec 09, 2014 12:12PM | |
# ================================================ | |
dir="$1" | |
[ -n "$dir" ] || dir=`pwd` | |
pidfile="$dir/.sass.pid" | |
logfile="$dir/.sass.log" | |
if [ -f $pidfile ]; then | |
kill -9 `cat $pidfile` >/dev/null 2>&1 | |
rm -rf $pidfile | |
[ "$1" = "stop" ] && echo 'shutdown!' && exit 0; | |
fi | |
set -e | |
if [ ! -f "$dir/config.rb" ]; then | |
echo "config.rb not found. please run 'compass init' first." | |
exit 0; | |
fi | |
compass compile "$dir" >$logfile 2>&1& | |
nohup compass watch --poll "$dir" >>$logfile 2>&1 & | |
echo $! >$pidfile | |
echo "compass watch success, pid: $!"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment