Minify css
[gitphp.git] / util / minify.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/bash
#
# minify.sh
#
# Minfies javascript files
#
# @author Christopher Han <xiphux@gmail.com>
# @copyright Copyright (c) 2010 Christopher Han
# @package GitPHP
# @subpackage util
#
 
JSDIR="js"
COMPRESSORDIR="lib/yuicompressor/build"
COMPRESSORJAR="yuicompressor-2.4.2.jar"
 
JSEXT=".js"
MINEXT=".min.js"
 
CSSDIR="css"
CSSEXT=".css"
MINCSSEXT=".min.css"
 
rm -f ${JSDIR}/*${MINEXT}
 
for i in ${JSDIR}/*${JSEXT}; do
        echo "Minifying ${i}..."
        java -jar "${COMPRESSORDIR}/${COMPRESSORJAR}" --charset utf-8 -o "${i%$JSEXT}${MINEXT}" "${i}"
done
 
rm -f ${CSSDIR}/*${MINCSSEXT}
 
for i in ${CSSDIR}/*${CSSEXT}; do
        echo "Minifying ${i}..."
        java -jar "${COMPRESSORDIR}/${COMPRESSORJAR}" --charset utf-8 -o "${i%$CSSEXT}${MINCSSEXT}" "${i}"
done
 
comments