minify CSS
This commit is contained in:
parent
7dab0517a4
commit
49ac5ae7f5
|
@ -37,6 +37,20 @@ function minify {
|
|||
done
|
||||
}
|
||||
|
||||
# minifies the CSS files
|
||||
function minifyCSS {
|
||||
local dir="$1"
|
||||
echo "Minify CSS files in $dir"
|
||||
local files=`ls $dir/*.css`
|
||||
for file in $files; do
|
||||
yui-compressor --nomunge --preserve-semi --disable-optimizations --charset UTF-8 -o ${file}-MIN $file
|
||||
rm $file
|
||||
mv ${file}-MIN $file
|
||||
# add final new line to supress Debian warnings
|
||||
echo "" >> $file
|
||||
done
|
||||
}
|
||||
|
||||
echo "Getting files..."
|
||||
git clone git@github.com:LDAPAccountManager/lam.git github
|
||||
cd github
|
||||
|
@ -97,6 +111,7 @@ mv ldap-account-manager-$VERSION.tar.bz2 Debian/ldap-account-manager_$VERSION.or
|
|||
cp -ar ldap-account-manager-$VERSION Debian/
|
||||
# build other packages with minified JS files
|
||||
minify ldap-account-manager-$VERSION/templates/lib
|
||||
minifyCSS ldap-account-manager-$VERSION/style
|
||||
tar cfj ldap-account-manager-$VERSION.tar.bz2 --owner=root --group=root --mtime=now ldap-account-manager-$VERSION
|
||||
rm -r ldap-account-manager-$VERSION
|
||||
|
||||
|
@ -116,6 +131,7 @@ mv ldap-account-manager-$VERSION.tar.bz2 Debian/ldap-account-manager_$VERSION.or
|
|||
cp -ar ldap-account-manager-$VERSION Debian/
|
||||
# build other packages with minified JS files
|
||||
minify ldap-account-manager-$VERSION/templates/lib
|
||||
minifyCSS ldap-account-manager-$VERSION/style
|
||||
tar cfj ldap-account-manager-$VERSION.tar.bz2 --owner=root --group=root --mtime=now ldap-account-manager-$VERSION
|
||||
rm -r ldap-account-manager-$VERSION
|
||||
cd ..
|
||||
|
|
|
@ -2,8 +2,7 @@
|
|||
|
||||
set -e
|
||||
|
||||
dir="templates/lib"
|
||||
files=`ls $dir/*.js`
|
||||
files=`ls templates/lib/*.js style/*.css`
|
||||
for file in $files; do
|
||||
# skip dropmenu file, incompatible with YUI compressor
|
||||
if [[ $file =~ .*dropmenu.* ]]; then
|
||||
|
|
Loading…
Reference in New Issue