1
0
mirror of https://github.com/kubernetes-sigs/descheduler.git synced 2026-01-26 13:29:11 +01:00

Merge pull request #988 from spike-liu/find-dirs-containing_comment_tags

Fix wired behavior during code generating
This commit is contained in:
Kubernetes Prow Robot
2022-10-17 10:49:07 -07:00
committed by GitHub

View File

@@ -5,8 +5,7 @@
# 2. find all the files containing specific tags in contents; # 2. find all the files containing specific tags in contents;
# 3. extract related dirs; # 3. extract related dirs;
# 4. remove duplicated paths; # 4. remove duplicated paths;
# 5. replace . with ${PRJ_PREFIX} # 5. merge all dirs in array with delimiter ,;
# 6. merge all dirs in array with delimiter ,;
# #
# Example: # Example:
# find_dirs_containing_comment_tags("+k8s:") # find_dirs_containing_comment_tags("+k8s:")
@@ -15,11 +14,10 @@
function find_dirs_containing_comment_tags() { function find_dirs_containing_comment_tags() {
array=() array=()
while IFS='' read -r line; do array+=("$line"); done < <( \ while IFS='' read -r line; do array+=("$line"); done < <( \
find . -type f -name \*.go -not -path "./vendor/*" -print0 \ find . -type f -name \*.go -not -path "./vendor/*" -not -path "./_tmp/*" -print0 \
| xargs -0 grep --color=never -l "$@" \ | xargs -0 grep --color=never -l "$@" \
| xargs -n1 dirname \ | xargs -n1 dirname \
| LC_ALL=C sort -u \ | LC_ALL=C sort -u \
| sed "s|.|${PRJ_PREFIX}|" \
) )
IFS=","; IFS=",";