1
0
mirror of https://github.com/Tygs/0bin.git synced 2023-08-10 21:13:00 +03:00
0bin/tools/Makefile

26 lines
961 B
Makefile
Raw Normal View History

2013-04-20 20:22:11 +04:00
zerobinpaste: zerobinpaste.js commander.js ../zerobin/static/js/sjcl.js ../zerobin/static/js/lzw.js
echo '#!/usr/bin/env node' > zerobinpaste
cat commander.js ../zerobin/static/js/sjcl.js ../zerobin/static/js/lzw.js >> zerobinpaste
cat zerobinpaste.js >> zerobinpaste
chmod +x zerobinpaste
ugly: zerobinpaste
uglifyjs=$$(PATH="$$(npm bin):$$PATH" which uglifyjs 2>/dev/null) \
|| { npm install uglify-js; uglifyjs=$$(PATH="$$(npm bin):$$PATH" which uglifyjs); } \
&& sed -i 1d zerobinpaste \
&& $${uglifyjs} -o zerobinpaste.min zerobinpaste \
&& echo '#!/usr/bin/env node' > zerobinpaste \
&& cat zerobinpaste.min >> zerobinpaste \
&& chmod +x zerobinpaste
clean:
rm -f zerobinpaste{,.js,.min}
zerobinpaste.js: zerobinpaste.coffee
coffee=$$(PATH="$$(npm bin):$$PATH" which coffee 2>/dev/null) \
|| { npm install coffee-script; coffee=$$(PATH="$$(npm bin):$$PATH" which coffee); } \
&& $$coffee -c zerobinpaste.coffee
.PHONY: uglify