Last active
August 29, 2015 14:04
-
-
Save allex/965f3e1a0876592db33f 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/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 | |
# ================================================ | |
firstArg="$1" | |
if [ "$firstArg" != "-s" ]; then | |
dir=$firstArg | |
else | |
shutdown=1 | |
fi | |
[ -n "$dir" ] || dir=`pwd` | |
dir=`cd -P -- "$dir" && pwd -P` | |
pidfile="$dir/.sass.pid" | |
logfile="$dir/.sass.log" | |
if [ -f $pidfile ]; then | |
kill -9 `cat $pidfile` >/dev/null 2>&1 | |
rm -rf $pidfile | |
fi | |
[ $shutdown ] && { echo 'shutdown!'; exit 0; } | |
set -e | |
if [ ! -f "$dir/config.rb" ]; then | |
echo "config.rb not found. please run 'compass init' first." | |
exit 0; | |
fi | |
pushd $dir >/dev/null | |
compass compile "$dir" >$logfile 2>&1& | |
nohup compass watch >>$logfile 2>&1& | |
echo $! >$pidfile | |
echo "compass watch success, pid: $!"; | |
popd >/dev/null |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
While getting errros, it is getting stop.
Even while errors, I do want to restart / do not stop compiling even If it has errors.
any clues, please...