Tolerate unset $GOBIN

This commit is contained in:
Marcin Owsiany 2019-11-18 08:17:05 -08:00 committed by GitHub
parent f7e6b7a817
commit d931b8434b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -52,8 +52,9 @@ shift 4
cd "$(dirname "${0}")"
go install ./cmd/{defaulter-gen,client-gen,lister-gen,informer-gen,deepcopy-gen}
)
# We expect the above commands to get installed here:
gobin="$(go env GOBIN)"
# Go installs the above commands to get installed in $GOBIN if defined, and $GOPATH/bin otherwise:
GOBIN="$(go env GOBIN)"
gobin="${GOBIN:-$(go env GOPATH)/bin}"
function codegen::join() { local IFS="$1"; shift; echo "$*"; }