diff --git a/Makefile b/Makefile index b0c83eb25b2d..d7374decf9b4 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ GOOS ?= $(shell go env GOOS) GOARCH ?= $(shell go env GOARCH) -VERSION ?= '$(shell hack/version.sh)' +VERSION ?= '$(git describe --tags --dirty)' # Images management REGISTRY?="docker.io/karmada" @@ -110,7 +110,7 @@ GOTEST=go test .PHONY: install_gotest install_gotest: -ifdef COLOR_GOTEST_ENABLED +ifdef COLOR_GOTEST_ENABLED go install ${COLOR_GOTEST_REGISTRY}@${COLOR_GOTEST_VERSION} GOTEST=gotest endif diff --git a/hack/util.sh b/hack/util.sh index 583c4330a8d7..0482a5128205 100755 --- a/hack/util.sh +++ b/hack/util.sh @@ -668,13 +668,9 @@ function util::get_macos_ipaddress() { fi } -function util::get_version() { - git describe --tags --dirty -} - function util::version_ldflags() { # Git information - GIT_VERSION=$(util::get_version) + GIT_VERSION=$(git describe --tags --dirty) GIT_COMMIT_HASH=$(git rev-parse HEAD) if git_status=$(git status --porcelain 2>/dev/null) && [[ -z ${git_status} ]]; then GIT_TREESTATE="clean" diff --git a/hack/version.sh b/hack/version.sh deleted file mode 100755 index 629bed5f7166..000000000000 --- a/hack/version.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env bash - -set -o errexit -set -o nounset -set -o pipefail - -KARMADA_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd -P)" -source "${KARMADA_ROOT}/hack/util.sh" - -util::get_version