Skip to content

Commit 67d82e4

Browse files
aireillyopenshift-cherrypick-robot
authored andcommitted
fixing scripts/get-updated-preview-urls.sh
1 parent 17a84bc commit 67d82e4

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

scripts/get-updated-preview-urls.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22
# Returns a list of page preview URLs
33
# To run locally, clean the _preview folder and do a new asciibinder build before running the script
4-
# To run in Prow CI, run with
4+
# To run in Prow CI, run with
55
# ./get-updated-preview-urls.sh $PULL_NUMBER
66

77
# Check if jq is installed
@@ -34,7 +34,7 @@ fi
3434
# Search for $file references in all *.adoc files that are not in a folder called modules/, snippets/, or _unused_topics/
3535
for file in $files; do
3636
include_ref="include::$file"
37-
found_file=$(find . -name '*.adoc' -not -path "modules/*" -not -path "snippets/*" -not -path "_unused_topics/*" -exec grep -rl "^$include_ref" {} +)
37+
found_file=$(grep -rl --include='*.adoc' --exclude-dir={modules,snippets,_unused_topics} "^$include_ref")
3838
# Add the found updated assemblies, not directly included in PR
3939
assemblies+=("$found_file")
4040
# If not found, then it is a directly updated assembly file
@@ -43,9 +43,11 @@ for file in $files; do
4343
fi
4444
done
4545

46-
# Make the HTML URL slug
46+
# Make the HTML URL slugs
4747
if [ ${#assemblies[@]} -gt 0 ]; then
48-
updated_pages=$(echo "${assemblies[@]}" | sed 's/\.adoc$/.html/' | sort | uniq)
48+
for assembly in "${assemblies[@]}"; do
49+
updated_pages+=$(echo "$assembly" | sed 's/\.adoc$/.html/' | tr '\n' ' ')
50+
done
4951
fi
5052

5153
# Search built_pages for every entry in updated_pages and add to pages array when it is found

0 commit comments

Comments
 (0)