mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-06 18:54:06 +00:00
Merge pull request #122228 from thockin/cleaner_make_clean
Simpler and less noisy make-clean
This commit is contained in:
commit
abb336b9c9
@ -24,15 +24,14 @@ source "${KUBE_ROOT}/hack/lib/util.sh"
|
|||||||
CLEAN_PATTERNS=(
|
CLEAN_PATTERNS=(
|
||||||
"_tmp"
|
"_tmp"
|
||||||
"doc_tmp"
|
"doc_tmp"
|
||||||
"((?!staging\/src\/k8s\.io\/apiextensions-apiserver\/pkg\/generated\/openapi).)*/zz_generated.openapi.go"
|
|
||||||
"test/e2e/generated/bindata.go"
|
"test/e2e/generated/bindata.go"
|
||||||
)
|
)
|
||||||
|
|
||||||
for pattern in "${CLEAN_PATTERNS[@]}"; do
|
for item in "${CLEAN_PATTERNS[@]}"; do
|
||||||
while IFS=$'\n' read -r match; do
|
# Shellcheck wants the ":?" because of paranoia about 'rm -rf /'. It will
|
||||||
echo "Removing ${match#"${KUBE_ROOT}"\/} .."
|
# cause an error if unset, which is already true because of "nounset", but
|
||||||
rm -rf "${match#"${KUBE_ROOT}"\/}"
|
# belts AND suspenders is fine for this.
|
||||||
done < <(find "${KUBE_ROOT}" -iregex "^${KUBE_ROOT}/${pattern}$")
|
rm -rf "${KUBE_ROOT:?}/${item:?}"
|
||||||
done
|
done
|
||||||
|
|
||||||
# ex: ts=2 sw=2 et filetype=sh
|
# ex: ts=2 sw=2 et filetype=sh
|
||||||
|
Loading…
Reference in New Issue
Block a user