github.com/nikron/prototool@v1.3.0/etc/bin/brewgen.sh (about) 1 #!/bin/sh 2 3 set -eu 4 5 DIR="$(cd "$(dirname "${0}")/../.." && pwd)" 6 cd "${DIR}" 7 8 BUILD_DIR="brew" 9 10 rm -rf vendor 11 glide install 12 rm -rf "${BUILD_DIR}" 13 mkdir -p "${BUILD_DIR}/bin" 14 mkdir -p "${BUILD_DIR}/etc/bash_completion.d" 15 mkdir -p "${BUILD_DIR}/etc/zsh/site-functions" 16 mkdir -p "${BUILD_DIR}/share/man/man1" 17 go run internal/cmd/gen-prototool-bash-completion/main.go > "${BUILD_DIR}/etc/bash_completion.d/prototool" 18 go run internal/cmd/gen-prototool-zsh-completion/main.go > "${BUILD_DIR}/etc/zsh/site-functions/_prototool" 19 go run internal/cmd/gen-prototool-manpages/main.go "${BUILD_DIR}/share/man/man1" 20 CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 \ 21 go build \ 22 -a \ 23 -installsuffix cgo \ 24 -ldflags "-X 'github.com/uber/prototool/internal/vars.GitCommit=$(git rev-list -1 HEAD)' -X 'github.com/uber/prototool/internal/vars.BuiltTimestamp=$(date -u)'" \ 25 -o "${BUILD_DIR}/bin/prototool" \ 26 internal/cmd/prototool/main.go