Skip to content

Commit d931b84

Browse files
authored
Tolerate unset $GOBIN
1 parent f7e6b7a commit d931b84

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

staging/src/k8s.io/code-generator/generate-groups.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,9 @@ shift 4
5252
cd "$(dirname "${0}")"
5353
go install ./cmd/{defaulter-gen,client-gen,lister-gen,informer-gen,deepcopy-gen}
5454
)
55-
# We expect the above commands to get installed here:
56-
gobin="$(go env GOBIN)"
55+
# Go installs the above commands to get installed in $GOBIN if defined, and $GOPATH/bin otherwise:
56+
GOBIN="$(go env GOBIN)"
57+
gobin="${GOBIN:-$(go env GOPATH)/bin}"
5758

5859
function codegen::join() { local IFS="$1"; shift; echo "$*"; }
5960

0 commit comments

Comments
 (0)