Skip to content

Instantly share code, notes, and snippets.

@c0ze
Created April 10, 2016 11:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save c0ze/c18ecbd3555685e8e4cb24e8fa8f8cad to your computer and use it in GitHub Desktop.
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
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