mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-10-31 02:08:13 +00:00 
			
		
		
		
	Skip vendor directory when removing generated files
This commit is contained in:
		| @@ -52,13 +52,15 @@ function git_find() { | |||||||
|     # Similar to find but faster and easier to understand.  We want to include |     # Similar to find but faster and easier to understand.  We want to include | ||||||
|     # modified and untracked files because this might be running against code |     # modified and untracked files because this might be running against code | ||||||
|     # which is not tracked by git yet. |     # which is not tracked by git yet. | ||||||
|     git ls-files -cmo --exclude-standard "$@" |     git ls-files -cmo --exclude-standard ':!:vendor/*' "$@" | ||||||
| } | } | ||||||
|  |  | ||||||
| function git_grep() { | function git_grep() { | ||||||
|     # We want to include modified and untracked files because this might be |     # We want to include modified and untracked files because this might be | ||||||
|     # running against code which is not tracked by git yet. |     # running against code which is not tracked by git yet. | ||||||
|     git grep --untracked "$@" |     # We need vendor exclusion added at the end since it has to be part of | ||||||
|  |     # the pathspecs which are specified last. | ||||||
|  |     git grep --untracked "$@" ':!:vendor/*' | ||||||
| } | } | ||||||
|  |  | ||||||
| # Generate a list of all files that have a `+k8s:` comment-tag.  This will be | # Generate a list of all files that have a `+k8s:` comment-tag.  This will be | ||||||
| @@ -77,7 +79,6 @@ kube::util::read-array ALL_K8S_TAG_FILES < <( | |||||||
|     git_grep -l \ |     git_grep -l \ | ||||||
|         -e '^// *+k8s:'                `# match +k8s: tags` \ |         -e '^// *+k8s:'                `# match +k8s: tags` \ | ||||||
|         -- \ |         -- \ | ||||||
|         ':!:vendor/*'                  `# not under vendor` \ |  | ||||||
|         ':!:*/testdata/*'              `# not under any testdata` \ |         ':!:*/testdata/*'              `# not under any testdata` \ | ||||||
|         ':(glob)**/*.go'               `# in any *.go file` \ |         ':(glob)**/*.go'               `# in any *.go file` \ | ||||||
|         | sed 's|^staging/src|vendor|' `# see comments above` \ |         | sed 's|^staging/src|vendor|' `# see comments above` \ | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Maciej Szulik
					Maciej Szulik