From 85c01e8d22cee03fc0503ec54d54ef636ff5b209 Mon Sep 17 00:00:00 2001 From: janisar007 Date: Fri, 6 Dec 2024 13:01:47 +0530 Subject: [PATCH] Update build.sh --- scripts/build.sh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/scripts/build.sh b/scripts/build.sh index 11e6bd6..447e20f 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -1,19 +1,19 @@ #!/usr/bin/env bash + set -euo pipefail -GOMOD=$(head -1 go.mod | awk '{print $2}') -GOOS="linux" GOARCH="amd64" go build -ldflags='-s -w' -o linux/amd64/bin/main "$GOMOD/cmd/main" -GOOS="linux" GOARCH="arm64" go build -ldflags='-s -w' -o linux/arm64/bin/main "$GOMOD/cmd/main" +GOOS="linux" go build -ldflags='-s -w' -o bin/main github.com/initializ-buildpacks/procfile/v5/cmd/main +GOOS="windows" GOARCH="amd64" go build -ldflags='-s -w' -o bin/main.exe github.com/initializ-buildpacks/procfile/v5/cmd/main if [ "${STRIP:-false}" != "false" ]; then - strip linux/amd64/bin/main linux/arm64/bin/main + strip bin/main bin/main.exe fi if [ "${COMPRESS:-none}" != "none" ]; then - $COMPRESS linux/amd64/bin/main linux/arm64/bin/main + $COMPRESS bin/main bin/main.exe fi -ln -fs main linux/amd64/bin/build -ln -fs main linux/arm64/bin/build -ln -fs main linux/amd64/bin/detect -ln -fs main linux/arm64/bin/detect \ No newline at end of file +ln -fs main bin/build +ln -fs main bin/detect +ln -fs main.exe bin/build.exe +ln -fs main.exe bin/detect.exe