diff --git a/build.sh b/build.sh index c36a2792..c87c719d 100755 --- a/build.sh +++ b/build.sh @@ -6,46 +6,62 @@ indent() { } echo "Cleaning up old build" + echo "--> Removing build directory" rm -rfv build 2>&1 | indent echo echo "Installing dependencies" + echo "--> go-bindata" go get -u -v github.com/jteeuwen/go-bindata/... 2>&1 | indent + echo "--> go-bindata-assetfs" go get -u -v github.com/elazarl/go-bindata-assetfs/... 2>&1 | indent + echo "--> etree" go get -u -v github.com/beevik/etree 2>&1 | indent + echo "--> go-zglob" go get -u -v github.com/mattn/go-zglob 2>&1 | indent + echo "--> resize" go get -u -v github.com/nfnt/resize 2>&1 | indent + echo "--> zipfs" go get -u -v golang.org/x/tools/godoc/vfs/zipfs 2>&1 | indent echo echo "Building" + echo "--> Creating build directory" mkdir -vp build 2>&1 | indent -echo "--> Generating bindata" -go-bindata-assetfs static/... 2>&1 | indent + +echo "Generating bindata" +go generate + echo "--> Building BookBrowser for Linux 64bit" env GOOS=linux GOARCH=amd64 go build -o build/BookBrowser-linux-64bit 2>&1 | indent + if [[ "$1" == "all" ]]; then -echo "--> Building BookBrowser for Linux 32bit" -env GOOS=linux GOARCH=386 go build -o build/BookBrowser-linux-32bit 2>&1 | indent -echo "--> Building BookBrowser for Windows 64bit" -env GOOS=windows GOARCH=amd64 go build -o build/BookBrowser-windows-64bit.exe 2>&1 | indent -echo "--> Building BookBrowser for Windows 32bit" -env GOOS=windows GOARCH=386 go build -o build/BookBrowser-windows-32bit.exe 2>&1 | indent -echo "--> Building BookBrowser for Darwin 64bit" -env GOOS=darwin GOARCH=amd64 go build -o build/BookBrowser-darwin-64bit 2>&1 | indent -echo "--> Building BookBrowser for Darwin 32bit" -env GOOS=darwin GOARCH=386 go build -o build/BookBrowser-darwin-32bit 2>&1 | indent + echo "--> Building BookBrowser for Linux 32bit" + env GOOS=linux GOARCH=386 go build -o build/BookBrowser-linux-32bit 2>&1 | indent + + echo "--> Building BookBrowser for Windows 64bit" + env GOOS=windows GOARCH=amd64 go build -o build/BookBrowser-windows-64bit.exe 2>&1 | indent + + echo "--> Building BookBrowser for Windows 32bit" + env GOOS=windows GOARCH=386 go build -o build/BookBrowser-windows-32bit.exe 2>&1 | indent + + echo "--> Building BookBrowser for Darwin 64bit" + env GOOS=darwin GOARCH=amd64 go build -o build/BookBrowser-darwin-64bit 2>&1 | indent + + echo "--> Building BookBrowser for Darwin 32bit" + env GOOS=darwin GOARCH=386 go build -o build/BookBrowser-darwin-32bit 2>&1 | indent fi echo + echo "Cleaning up" echo "--> Removing bindata" rm -rfv bindata_assetfs.go 2>&1 | indent diff --git a/build/BookBrowser-darwin-32bit.exe b/build/BookBrowser-darwin-32bit.exe deleted file mode 100755 index 72e117ff..00000000 Binary files a/build/BookBrowser-darwin-32bit.exe and /dev/null differ diff --git a/build/BookBrowser-darwin-64bit.exe b/build/BookBrowser-darwin-64bit.exe deleted file mode 100755 index dc9d415e..00000000 Binary files a/build/BookBrowser-darwin-64bit.exe and /dev/null differ diff --git a/build/BookBrowser-linux-32bit b/build/BookBrowser-linux-32bit deleted file mode 100755 index eb80145e..00000000 Binary files a/build/BookBrowser-linux-32bit and /dev/null differ diff --git a/build/BookBrowser-linux-64bit b/build/BookBrowser-linux-64bit deleted file mode 100755 index 2ff7e371..00000000 Binary files a/build/BookBrowser-linux-64bit and /dev/null differ diff --git a/build/BookBrowser-windows-32bit.exe b/build/BookBrowser-windows-32bit.exe deleted file mode 100755 index 44eeb826..00000000 Binary files a/build/BookBrowser-windows-32bit.exe and /dev/null differ diff --git a/build/BookBrowser-windows-64bit.exe b/build/BookBrowser-windows-64bit.exe deleted file mode 100755 index 4b29b62e..00000000 Binary files a/build/BookBrowser-windows-64bit.exe and /dev/null differ diff --git a/server.go b/server.go index 0933ec14..b01fbdf2 100644 --- a/server.go +++ b/server.go @@ -1,5 +1,7 @@ package main +//go:generate go-bindata-assetfs static/... + import ( "bytes" "fmt"