hack/lib/util.sh: improve staging api finding.

Do not bother with pushd/popd construct -- there is no need to go back
to original directory in a subshell. Use "find --exec" instead of "find
| xargs" to handle special file names better.
This commit is contained in:
Ismo Puustinen 2018-02-14 13:18:28 +02:00
parent 39f4763afe
commit 4a82a011a0

View File

@ -244,11 +244,9 @@ kube::util::remove-gen-docs() {
kube::util::group-version-to-pkg-path() {
staging_apis=(
$(
pushd ${KUBE_ROOT}/staging/src/k8s.io/api > /dev/null
find . -name types.go | xargs -n1 dirname | sed "s|\./||g" | sort
popd > /dev/null
)
)
cd "${KUBE_ROOT}/staging/src/k8s.io/api" &&
find . -name types.go -exec dirname {} \; | sed "s|\./||g" | sort
))
local group_version="$1"