2012-12-19 02:56:37 +00:00
|
|
|
#!/bin/sh
|
|
|
|
set -e
|
|
|
|
|
2012-12-19 23:36:50 +00:00
|
|
|
case "$1" in
|
|
|
|
"shell")
|
|
|
|
cat > _tmp.go <<EOWEBASSETSGO
|
|
|
|
// WARNING: GENERATED FILE, NERDS! $(date)
|
|
|
|
package conway
|
|
|
|
|
|
|
|
const (
|
|
|
|
GAME_OF_LIFE_INDEX_HTML = \`
|
|
|
|
$(cat web_assets/index.html | gzip -9 | base64)\`
|
|
|
|
NORMALIZE_CSS = \`
|
|
|
|
$(curl -s http://necolas.github.com/normalize.css/2.0.1/normalize.css | gzip -9 | base64)\`
|
|
|
|
JQUERY_MIN_JS = \`
|
|
|
|
$(curl -s http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js | gzip -9 | base64)\`
|
|
|
|
)
|
|
|
|
EOWEBASSETSGO
|
|
|
|
cat _tmp.go | gofmt > web_assets.go
|
|
|
|
rm -v _tmp.go
|
|
|
|
;;
|
|
|
|
*)
|
2012-12-19 02:56:37 +00:00
|
|
|
cd web_assets
|
2012-12-19 03:03:26 +00:00
|
|
|
go build -x .
|
2012-12-19 05:23:22 +00:00
|
|
|
./web_assets index.html > _tmp.go
|
|
|
|
gofmt < _tmp.go > ../web_assets.go
|
|
|
|
rm -vf _tmp.go
|
2012-12-19 23:36:50 +00:00
|
|
|
;;
|
|
|
|
esac
|