From 4a82a011a0132052dfefb5b6a2d383a5dc8ae234 Mon Sep 17 00:00:00 2001 From: Ismo Puustinen Date: Wed, 14 Feb 2018 13:18:28 +0200 Subject: [PATCH] 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. --- hack/lib/util.sh | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/hack/lib/util.sh b/hack/lib/util.sh index 35764f68995..cc7f8945a3f 100755 --- a/hack/lib/util.sh +++ b/hack/lib/util.sh @@ -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"