Make update-codegen avoid sub-workspaces
This commit is contained in:
		@@ -48,11 +48,20 @@ if [[ "${DBG_CODEGEN}" == 1 ]]; then
 | 
				
			|||||||
    kube::log::status "DBG: starting generated_files"
 | 
					    kube::log::status "DBG: starting generated_files"
 | 
				
			||||||
fi
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Generate a list of directories we don't want to play in.
 | 
				
			||||||
 | 
					DIRS_TO_AVOID=()
 | 
				
			||||||
 | 
					kube::util::read-array DIRS_TO_AVOID < <(
 | 
				
			||||||
 | 
					    git ls-files -cmo --exclude-standard -- ':!:vendor/*' ':(glob)*/**/go.work' \
 | 
				
			||||||
 | 
					        | while read -r F; do \
 | 
				
			||||||
 | 
					            echo ':!:'"$(dirname "${F}")"; \
 | 
				
			||||||
 | 
					        done
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function git_find() {
 | 
					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 ':!:vendor/*' "$@"
 | 
					    git ls-files -cmo --exclude-standard ':!:vendor/*' "${DIRS_TO_AVOID[@]}" "$@"
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function git_grep() {
 | 
					function git_grep() {
 | 
				
			||||||
@@ -60,7 +69,7 @@ function git_grep() {
 | 
				
			|||||||
    # running against code which is not tracked by git yet.
 | 
					    # running against code which is not tracked by git yet.
 | 
				
			||||||
    # We need vendor exclusion added at the end since it has to be part of
 | 
					    # We need vendor exclusion added at the end since it has to be part of
 | 
				
			||||||
    # the pathspecs which are specified last.
 | 
					    # the pathspecs which are specified last.
 | 
				
			||||||
    git grep --untracked "$@" ':!:vendor/*'
 | 
					    git grep --untracked "$@" ':!:vendor/*' "${DIRS_TO_AVOID[@]}"
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# 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
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user