forked from http-kit/http-kit.github.com
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpreprocess
More file actions
executable file
·29 lines (25 loc) · 797 Bytes
/
preprocess
File metadata and controls
executable file
·29 lines (25 loc) · 797 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#! /bin/bash
if [ $# -eq 0 ]; then # show help
echo "Used to preprocss some file: like compile scss, cleanup html before reload browsers"
exit 1
fi
# this script is runned with CWD = root param passed to http-watcher
# [event file] pairs are passed as command line args
while [ $# -ne 0 ]; do
event=$1; shift # event name
file=$1; shift # file name
extention=${file##*.} # file extension
echo $file, $event
case $extention in
scss) # compile scss to css
rake css
;;
html)
rake generate
;;
md) # compress the changed mustache template using htmlcompressor
rake generate
;;
esac
done
# http-watcher -ignores _site -command ./preprocess