diff --git a/go.mod b/go.mod index 5e5e701..72528db 100644 --- a/go.mod +++ b/go.mod @@ -5,8 +5,8 @@ go 1.22 require ( github.com/spf13/cobra v1.7.0 gotest.tools/v3 v3.3.0 - knative.dev/client-pkg v0.0.0-20240808015000-22f598931483 - knative.dev/hack v0.0.0-20240814130635-06f7aff93954 + knative.dev/client-pkg v0.0.0-20240909014924-788e0725213a + knative.dev/hack v0.0.0-20240909014011-fc6a8452af6d ) require ( diff --git a/go.sum b/go.sum index dea1843..8b88923 100644 --- a/go.sum +++ b/go.sum @@ -79,10 +79,10 @@ k8s.io/klog/v2 v2.120.1 h1:QXU6cPEOIslTGvZaXvFWiP9VKyeet3sawzTOvdXb4Vw= k8s.io/klog/v2 v2.120.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= k8s.io/utils v0.0.0-20240102154912-e7106e64919e h1:eQ/4ljkx21sObifjzXwlPKpdGLrCfRziVtos3ofG/sQ= k8s.io/utils v0.0.0-20240102154912-e7106e64919e/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= -knative.dev/client-pkg v0.0.0-20240808015000-22f598931483 h1:jBfmxcR0H5Z9IzamelZtmmg9jfeOXfssllUVX5M4Xzs= -knative.dev/client-pkg v0.0.0-20240808015000-22f598931483/go.mod h1:Y56KfZx3gJJpju88l86jQ9csxywLiopR0GkxCWW3+Kg= -knative.dev/hack v0.0.0-20240814130635-06f7aff93954 h1:dGMK5VoL75szvrYQTL9NqhPYHu1f5dGaXx1hJI8fAFM= -knative.dev/hack v0.0.0-20240814130635-06f7aff93954/go.mod h1:R0ritgYtjLDO9527h5vb5X6gfvt5LCrJ55BNbVDsWiY= +knative.dev/client-pkg v0.0.0-20240909014924-788e0725213a h1:YJOBxVgINAAP69sTXYogck1OYCO4WY64EOUYZZsWS3U= +knative.dev/client-pkg v0.0.0-20240909014924-788e0725213a/go.mod h1:LZur1NaQ0sSun/QEZ5R2I99bS5lOW//Y68JLpUEpkJc= +knative.dev/hack v0.0.0-20240909014011-fc6a8452af6d h1:mgROhGJG3+g0SBkaG4Y2HxrIOLN3ZZcN4+IFZla+Zqs= +knative.dev/hack v0.0.0-20240909014011-fc6a8452af6d/go.mod h1:R0ritgYtjLDO9527h5vb5X6gfvt5LCrJ55BNbVDsWiY= knative.dev/pkg v0.0.0-20240716082220-4355f0c73608 h1:BOiRzcnRS9Z5ruxlCiS/K1/Hb5bUN0X4W3xCegdcYQE= knative.dev/pkg v0.0.0-20240716082220-4355f0c73608/go.mod h1:M67lDZ4KbltYSon0Ox4/6qjlZNOIXW4Ldequ81yofbw= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= diff --git a/vendor/knative.dev/hack/codegen-library.sh b/vendor/knative.dev/hack/codegen-library.sh index 01a4313..42ece68 100644 --- a/vendor/knative.dev/hack/codegen-library.sh +++ b/vendor/knative.dev/hack/codegen-library.sh @@ -133,16 +133,18 @@ function restore-changes-if-its-copyright-year-only() { local difflist log "Cleaning up generated code" difflist="$(mktemp)" - git diff --exit-code --name-only > "$difflist" - # list git changes and skip those which differ only in the boilerplate year - while read -r file; do - # check if the file contains just the change in the boilerplate year - if [ "$(LANG=C git diff --exit-code --shortstat -- "$file")" = ' 1 file changed, 1 insertion(+), 1 deletion(-)' ] && \ - [[ "$(git diff --exit-code -U1 -- "$file" | grep -Ec '^[+-]\s*[*#]?\s*Copyright 2[0-9]{3}')" -eq 2 ]]; then - # restore changes to that file - git checkout -- "$file" - fi - done < "$difflist" + if ! git diff --exit-code --name-only > /dev/null; then + # list git changes and skip those which differ only in the boilerplate year + git diff --name-only > "$difflist" + while read -r file; do + # check if the file contains just the change in the boilerplate year + if [ "$(LANG=C git diff --exit-code --shortstat -- "$file")" = ' 1 file changed, 1 insertion(+), 1 deletion(-)' ] && \ + [[ "$(git diff --exit-code -U1 -- "$file" | grep -Ec '^[+-]\s*[*#]?\s*Copyright 2[0-9]{3}')" -eq 2 ]]; then + # restore changes to that file + git checkout -- "$file" + fi + done < "$difflist" + fi rm -f "$difflist" } diff --git a/vendor/knative.dev/hack/library.sh b/vendor/knative.dev/hack/library.sh index 08f2dba..d487a14 100644 --- a/vendor/knative.dev/hack/library.sh +++ b/vendor/knative.dev/hack/library.sh @@ -774,7 +774,7 @@ function go_update_deps() { function __clean_goworksum_if_exists() { if [ -f "$REPO_ROOT_DIR/go.work.sum" ]; then log.step 'Cleaning the go.work.sum file' - truncate --size 0 "$REPO_ROOT_DIR/go.work.sum" + truncate -s 0 "$REPO_ROOT_DIR/go.work.sum" fi } diff --git a/vendor/modules.txt b/vendor/modules.txt index fa44ad1..12d9fea 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -25,9 +25,9 @@ gotest.tools/v3/internal/assert gotest.tools/v3/internal/difflib gotest.tools/v3/internal/format gotest.tools/v3/internal/source -# knative.dev/client-pkg v0.0.0-20240808015000-22f598931483 +# knative.dev/client-pkg v0.0.0-20240909014924-788e0725213a ## explicit; go 1.22 knative.dev/client-pkg/pkg/plugin -# knative.dev/hack v0.0.0-20240814130635-06f7aff93954 +# knative.dev/hack v0.0.0-20240909014011-fc6a8452af6d ## explicit; go 1.21 knative.dev/hack