From 64ecb161d47a72a1dcfa1e69ae07e49806dfc0a2 Mon Sep 17 00:00:00 2001 From: Tim Hockin Date: Sat, 4 Mar 2023 16:28:21 -0800 Subject: [PATCH] Codegen: git grep returns non-zero if no match --- hack/update-codegen.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/hack/update-codegen.sh b/hack/update-codegen.sh index d5f28d71c4f..1b788ec2849 100755 --- a/hack/update-codegen.sh +++ b/hack/update-codegen.sh @@ -724,10 +724,11 @@ function codegen::applyconfigs() { done fi - git_grep -l --null \ + (git_grep -l --null \ -e '^// Code generated by applyconfiguration-gen. DO NOT EDIT.$' \ -- \ ':(glob)staging/src/k8s.io/client-go/**/*.go' \ + || true) \ | xargs -0 rm -f "${applyconfigurationgen}" \ @@ -776,10 +777,11 @@ function codegen::clients() { done fi - git_grep -l --null \ + (git_grep -l --null \ -e '^// Code generated by client-gen. DO NOT EDIT.$' \ -- \ ':(glob)staging/src/k8s.io/client-go/**/*.go' \ + || true) \ | xargs -0 rm -f "${clientgen}" \ @@ -819,10 +821,11 @@ function codegen::listers() { done fi - git_grep -l --null \ + (git_grep -l --null \ -e '^// Code generated by lister-gen. DO NOT EDIT.$' \ -- \ ':(glob)staging/src/k8s.io/client-go/**/*.go' \ + || true) \ | xargs -0 rm -f "${listergen}" \ @@ -859,10 +862,11 @@ function codegen::informers() { done fi - git_grep -l --null \ + (git_grep -l --null \ -e '^// Code generated by informer-gen. DO NOT EDIT.$' \ -- \ ':(glob)staging/src/k8s.io/client-go/**/*.go' \ + || true) \ | xargs -0 rm -f "${informergen}" \