Fix build scripts to be strict sh

This commit is contained in:
Tim Hockin 2024-06-21 08:59:01 -07:00
parent 9fac204a9c
commit 8ed7195384
No known key found for this signature in database
2 changed files with 3 additions and 5 deletions

View File

@ -16,7 +16,6 @@
set -o errexit set -o errexit
set -o nounset set -o nounset
set -o pipefail
if [ -z "${ARCH:-}" ]; then if [ -z "${ARCH:-}" ]; then
echo "ARCH must be set" echo "ARCH must be set"
@ -35,7 +34,7 @@ export CGO_ENABLED=0
export GOARCH="${ARCH}" export GOARCH="${ARCH}"
export GOOS="${OS}" export GOOS="${OS}"
if [[ "${BUILD_DEBUG:-}" == 1 ]]; then if [ "${BUILD_DEBUG:-}" -eq 1 ]; then
# Debugging - disable optimizations and inlining # Debugging - disable optimizations and inlining
gogcflags="all=-N -l" gogcflags="all=-N -l"
goasmflags="" goasmflags=""

View File

@ -16,7 +16,6 @@
set -o errexit set -o errexit
set -o nounset set -o nounset
set -o pipefail
export CGO_ENABLED=0 export CGO_ENABLED=0
export GOFLAGS="-mod=vendor" export GOFLAGS="-mod=vendor"
@ -25,7 +24,7 @@ echo "Running tests:"
go test -installsuffix "static" "$@" go test -installsuffix "static" "$@"
echo echo
echo -n "Checking gofmt: " echo "Checking gofmt: "
ERRS="$(go fmt "$@")" ERRS="$(go fmt "$@")"
if [ -n "${ERRS}" ]; then if [ -n "${ERRS}" ]; then
echo "FAIL - the following files need to be gofmt'ed:" echo "FAIL - the following files need to be gofmt'ed:"
@ -38,7 +37,7 @@ fi
echo "PASS" echo "PASS"
echo echo
echo -n "Checking go vet: " echo "Checking go vet: "
ERRS="$(go vet "$@" 2>&1 || true)" ERRS="$(go vet "$@" 2>&1 || true)"
if [ -n "${ERRS}" ]; then if [ -n "${ERRS}" ]; then
echo "FAIL" echo "FAIL"