diff --git a/hack/generate-authors.sh b/hack/generate-authors.sh index 5133ed5b02..da30edb5fb 100755 --- a/hack/generate-authors.sh +++ b/hack/generate-authors.sh @@ -3,7 +3,7 @@ set -e SCRIPTDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -ROOTDIR="$(git -C "$SCRIPTDIR" rev-parse --show-toplevel)" +ROOTDIR="$(cd "${SCRIPTDIR}/.." && pwd)" set -x diff --git a/hack/validate/no-module b/hack/validate/no-module index 67a9c559ad..917cc3e756 100755 --- a/hack/validate/no-module +++ b/hack/validate/no-module @@ -3,7 +3,7 @@ # Check that no one is trying to commit a go.mod. SCRIPTDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -ROOTDIR="$(git -C "$SCRIPTDIR" rev-parse --show-toplevel)" +ROOTDIR="$(cd "${SCRIPTDIR}/../.." && pwd)" if test -e "${ROOTDIR}/go.mod"; then { diff --git a/hack/with-go-mod.sh b/hack/with-go-mod.sh index 3be44d11ec..7c2448ae24 100755 --- a/hack/with-go-mod.sh +++ b/hack/with-go-mod.sh @@ -9,7 +9,7 @@ set -e SCRIPTDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -ROOTDIR="$(git -C "$SCRIPTDIR" rev-parse --show-toplevel)" +ROOTDIR="$(cd "${SCRIPTDIR}/.." && pwd)" if test -e "${ROOTDIR}/go.mod"; then {