File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -8,7 +8,9 @@ set -o pipefail
88# so all Go commands it runs need module mode
99export GOFLAGS=" "
1010
11- SCRIPT_ROOT=$( git rev-parse --show-toplevel)
11+ # Prefer git when the work tree is complete (e.g. Konflux copies submodule source without
12+ # the parent repo, so .git may reference a missing gitdir).
13+ SCRIPT_ROOT=$( git rev-parse --show-toplevel 2> /dev/null || (cd " $( dirname " ${BASH_SOURCE[0]} " ) /.." && pwd))
1214
1315# code-generator shell scripts aren't vendored (go work vendor only copies .go files)
1416# so we fetch the module path from the module cache
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ set -o errexit
44set -o nounset
55set -o pipefail
66
7- SCRIPT_ROOT=$( git rev-parse --show-toplevel)
7+ SCRIPT_ROOT=$( git rev-parse --show-toplevel 2> /dev/null || (cd " $( dirname " ${BASH_SOURCE[0]} " ) /.. " && pwd) )
88
99" ${SCRIPT_ROOT} /hack/update-clientgen.sh"
1010
You can’t perform that action at this time.
0 commit comments