From c508d133727db7068305cebe770e24bbc1d38289 Mon Sep 17 00:00:00 2001 From: Bjorn Neergaard Date: Mon, 14 Nov 2022 18:32:30 -0700 Subject: [PATCH] hack/go-mod-prepare.sh: find root robustly; make steps transparent Signed-off-by: Bjorn Neergaard (cherry picked from commit af8e955e8fadc44b65c0297e90bfb25efe3177f0) Signed-off-by: Bjorn Neergaard --- hack/go-mod-prepare.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/hack/go-mod-prepare.sh b/hack/go-mod-prepare.sh index f1fb655a5c..e5552aaa5f 100755 --- a/hack/go-mod-prepare.sh +++ b/hack/go-mod-prepare.sh @@ -1,8 +1,13 @@ #!/usr/bin/env bash -ROOTDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" +set -e -cat > "${ROOTDIR}/go.mod" << EOF +SCRIPTDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +ROOTDIR="$(git -C "$SCRIPTDIR" rev-parse --show-toplevel)" + +set -x + +tee "${ROOTDIR}/go.mod" << EOF module github.com/docker/docker go 1.18