Change pushd $d; go ...; popd to go -C $d ...

Just an annoyance in reading these scripts.
This commit is contained in:
Tim Hockin
2024-03-02 14:27:33 -08:00
parent 1fceb815ac
commit a0215badb8
10 changed files with 22 additions and 46 deletions

View File

@@ -127,15 +127,13 @@ done
# Install golangci-lint
echo "installing golangci-lint and logcheck plugin from hack/tools into ${GOBIN}"
pushd "${KUBE_ROOT}/hack/tools" >/dev/null
go install github.com/golangci/golangci-lint/cmd/golangci-lint
if [ "${golangci_config}" ]; then
# This cannot be used without a config.
# This uses `go build` because `go install -buildmode=plugin` doesn't work
# (on purpose: https://github.com/golang/go/issues/64964).
go build -o "${GOBIN}/logcheck.so" -buildmode=plugin sigs.k8s.io/logtools/logcheck/plugin
fi
popd >/dev/null
go -C "${KUBE_ROOT}/hack/tools" install github.com/golangci/golangci-lint/cmd/golangci-lint
if [ "${golangci_config}" ]; then
# This cannot be used without a config.
# This uses `go build` because `go install -buildmode=plugin` doesn't work
# (on purpose: https://github.com/golang/go/issues/64964).
go -C "${KUBE_ROOT}/hack/tools" build -o "${GOBIN}/logcheck.so" -buildmode=plugin sigs.k8s.io/logtools/logcheck/plugin
fi
if [ "${golangci_config}" ]; then
# The relative path to _output/local/bin only works if that actually is the