Permalink
Browse files

Add support to less files.

  • Loading branch information...
1 parent 9f1fc20 commit d523716c9cb6e99bf7a85dc2b24a659beb7addbf @arthurfurlan committed Oct 10, 2012
Showing with 18 additions and 0 deletions.
  1. +18 −0 src/minify.sh
View
@@ -86,6 +86,24 @@ find "$BASEDIR" -type f | egrep -v '\.min\.' | while read FILE; do
[ "$?" = "0" ] || cp "$FILE" "$DEST"
;;
+ less)
+ DEST="${NAME}.min.css"
+
+ ## check if the file needs to be minified
+ is_file_modified "$FILE" "$DEST"
+ [ "$?" = "1" ] || continue
+
+ ## create the new (and minified) version
+ echo "Compressing: ${DEST}"
+ lessc "${FILE}" --yui-compress > "${TEMP}"
+
+ ## less files cannot use the same rule of copying
+ ## the original file over the destination file if
+ ## the minified version was bigger than the original
+ ## because the less syntax could not be a valid css
+ ## syntax
+ ;;
+
png)
DEST="${NAME}.min.${TYPE}"
TEMP="${NAME}-nq8.${TYPE}"

0 comments on commit d523716

Please sign in to comment.