-
Notifications
You must be signed in to change notification settings - Fork 2.5k
/
Makefile
32 lines (25 loc) · 1.13 KB
/
Makefile
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
30
31
32
PROJECT_NAME=jquery-qrcode
all:
server:
python -m SimpleHTTPServer
build: minify
minify:
echo > /tmp/jquery.qrcode.tmp.js
head -2 src/jquery.qrcode.js >> /tmp/jquery.qrcode.tmp.js
cat src/qrcode.js >> /tmp/jquery.qrcode.tmp.js
tail -n +3 src/jquery.qrcode.js >> /tmp/jquery.qrcode.tmp.js
curl --data-urlencode "js_code@/tmp/jquery.qrcode.tmp.js" \
-d "output_format=text&output_info=compiled_code&compilation_level=SIMPLE_OPTIMIZATIONS" \
http://closure-compiler.appspot.com/compile \
> jquery.qrcode.min.js
homepage_build:
pandoc -A ~/.pandoc.header.html -s README.md -o index.html
sed -i "s/github.com\/you/github.com\/jeromeetienne\/$(PROJECT_NAME)/g" index.html
#################################################################################
# deploy #
#################################################################################
deploy: build
# assume there is something to commit
# use "git diff --exit-code HEAD" to know if there is something to commit
# so two lines: one if no commit, one if something to commit
git commit -a -m "New deploy" && git push -f origin HEAD:gh-pages && git reset HEAD~