Created
March 15, 2013 11:33
-
-
Save alexbaumgertner/5169270 to your computer and use it in GitHub Desktop.
bem-tools build script, ver 0.1
This file contains hidden or 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
#!/bin/bash | |
# put this script to /merged | |
# depends: npm install cssrb first | |
# create cssrb config file | |
BUILD_DIR=`pwd`/build | |
echo "exports.config = { \ | |
fromBase: '', \ | |
toBase: '${BUILD_DIR}/', \ | |
patterns: { \ | |
'blocks': '../templates/' \ | |
} \ | |
};" > cssrb.js | |
mkdir -p build/css/ build/js/ | |
cp _merged.js build/js/_merged.js | |
cp -R img build/img | |
echo `date` > merged.html | |
ls ../ | while read line; do | |
cp ../$line/$line.html build ; | |
done; | |
find . -name '_*.css' | while read line; do \ | |
cssrb -c cssrb.js $line build/css/$line -cp; \ | |
done | |
mv templates build/templates | |
rm cssrb.js merged.html |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ls ../ | while read line; do
replace _line(\S*).css to css/_merged$1.css
replace _line.js to js/_merged.js
replace " to '
done;