Created
April 10, 2016 11:39
-
-
Save c0ze/c18ecbd3555685e8e4cb24e8fa8f8cad to your computer and use it in GitHub Desktop.
shell script to compile a web/chrome app made with coffee-script / slim
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
TARGETDIR="./out" | |
rm -rf $TARGETDIR | |
# copy html | |
for file in $(find . -type f -name \*.html); do | |
dir="./$TARGETDIR/$(dirname ${file})" | |
mkdir -p "$dir" | |
cp $file "$dir/$(basename ${file%.*}).html" | |
done | |
# compile slim templates | |
for file in $(find . -type f -name \*.slim); do | |
dir="./$TARGETDIR/$(dirname ${file})" | |
mkdir -p "$dir" | |
slimrb -e ${file} "$dir/$(basename ${file%.*}).html" | |
done | |
# compile coffee script | |
for file in $(find . -type f -name \*.coffee); do | |
dir="./$TARGETDIR/$(dirname ${file})" | |
mkdir -p "$dir" | |
coffee -b -o "$dir" -c ${file} | |
done | |
# copy css | |
cp -r ./css $TARGETDIR | |
# copy fonts | |
cp -r ./fonts $TARGETDIR | |
# copy static js libs | |
cp -r ./vendor $TARGETDIR/js | |
cp manifest.json $TARGETDIR |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment