Created
December 26, 2011 23:53
-
-
Save sontek/1522303 to your computer and use it in GitHub Desktop.
Watch less files and generate css
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
#!/usr/bin/env bash | |
while :; do | |
find "$PWD" -name '*.less' | while read line; do | |
REPLACE=`echo $line | sed "s|\.less|\.css|"` | |
mt1=$(stat -c %Y $line) | |
mt2=$(stat -c %Y $REPLACE) | |
if [ "$mt1" -gt "$mt2" ]; then | |
echo "$line --> $REPLACE" | |
lessc --verbose "$line" "$REPLACE" | |
fi | |
done | |
sleep 2 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment