add comments and make jshint happy
This commit is contained in:
parent
5d9d386550
commit
7998cb409f
1 changed files with 24 additions and 3 deletions
27
build.sh
27
build.sh
|
@ -1,24 +1,45 @@
|
|||
#!/bin/bash
|
||||
|
||||
mkdir compiled -p
|
||||
#The compiled folder holds all the separate compiled CSS files.
|
||||
|
||||
subtypes=(general buttons grid headings icons iehacks inputs messages navbar tables)
|
||||
#You can change the subtypes used by changing this.
|
||||
|
||||
rm -f compiledcss.js
|
||||
rm -f entireframework.js
|
||||
rm -f entireframework.min.css
|
||||
#Remove the old files.
|
||||
|
||||
i="0"
|
||||
echo "var css = {" >> compiledcss.js
|
||||
#Begin making compiledcss.js
|
||||
|
||||
#For each subtype, we compile the LESS file, minify it, and concatenate it into two files:
|
||||
#entireframework.min.css and compiledcss.js
|
||||
for item in ${subtypes[*]}
|
||||
do
|
||||
lessc "less/"$item".less" > "compiled/"$item".css"
|
||||
#Compile all the LESS files.
|
||||
|
||||
java -jar yuicompressor-2.4.8.jar "compiled/"$item".css" -o "compiled/"$item".min.css"
|
||||
#Compress all the compiled CSS files.
|
||||
|
||||
echo -ne " \""$item"\": \"" >> compiledcss.js
|
||||
cat "compiled/"$item".min.css" >> compiledcss.js
|
||||
cat "compiled/"$item".min.css" >> entireframework.min.css
|
||||
echo -ne "\"" >> compiledcss.js
|
||||
#Write lines of JSON to compiledcss.js
|
||||
|
||||
cat "compiled/"$item".min.css" >> entireframework.min.css
|
||||
#Write the compiled and minified CSS to entireframework.min.css
|
||||
|
||||
if [ $((i+1)) -ne ${#subtypes[*]} ]
|
||||
then
|
||||
#This is a bit kludgy but whatever, bash is not my specialty.
|
||||
#If this isn't the last subtype, add a comma
|
||||
echo "," >> compiledcss.js
|
||||
fi
|
||||
i=$i+1
|
||||
done
|
||||
#Put an ending to compiledcss.js
|
||||
echo "" >> compiledcss.js
|
||||
echo "}" >> compiledcss.js
|
||||
echo "};" >> compiledcss.js
|
||||
|
|
Loading…
Add table
Reference in a new issue