From 663e8fcfc77fa8ead02ac0708678b0a6deb6af67 Mon Sep 17 00:00:00 2001 From: Daniel <dhaavi@users.noreply.github.com> Date: Fri, 12 Aug 2022 13:14:19 +0200 Subject: [PATCH] Build jess cli with correct binary name --- cmd/build | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cmd/build b/cmd/build index ab409b7..36b9ff6 100755 --- a/cmd/build +++ b/cmd/build @@ -50,6 +50,12 @@ echo "Please notice, that this build script includes metadata into the build." echo "This information is useful for debugging and license compliance." echo "Run the compiled binary with the version command to see the information included." +# build output name +BIN_NAME="jess" +if [[ "$GOOS" == "windows" ]]; then + BIN_NAME="${BIN_NAME}.exe" +fi + # build BUILD_PATH="github.com/safing/portbase/info" -go build -ldflags "-X ${BUILD_PATH}.commit=${BUILD_COMMIT} -X ${BUILD_PATH}.buildOptions=${BUILD_BUILDOPTIONS} -X ${BUILD_PATH}.buildUser=${BUILD_USER} -X ${BUILD_PATH}.buildHost=${BUILD_HOST} -X ${BUILD_PATH}.buildDate=${BUILD_DATE} -X ${BUILD_PATH}.buildSource=${BUILD_SOURCE}" "$@" +go build -o "${BIN_NAME}" -ldflags "-X ${BUILD_PATH}.commit=${BUILD_COMMIT} -X ${BUILD_PATH}.buildOptions=${BUILD_BUILDOPTIONS} -X ${BUILD_PATH}.buildUser=${BUILD_USER} -X ${BUILD_PATH}.buildHost=${BUILD_HOST} -X ${BUILD_PATH}.buildDate=${BUILD_DATE} -X ${BUILD_PATH}.buildSource=${BUILD_SOURCE}" "$@"