1
1
#! /bin/bash
2
2
# Returns a list of page preview URLs
3
3
# 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
5
5
# ./get-updated-preview-urls.sh $PULL_NUMBER
6
6
7
7
# Check if jq is installed
34
34
# Search for $file references in all *.adoc files that are not in a folder called modules/, snippets/, or _unused_topics/
35
35
for file in $files ; do
36
36
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 " )
38
38
# Add the found updated assemblies, not directly included in PR
39
39
assemblies+=(" $found_file " )
40
40
# If not found, then it is a directly updated assembly file
@@ -43,9 +43,11 @@ for file in $files; do
43
43
fi
44
44
done
45
45
46
- # Make the HTML URL slug
46
+ # Make the HTML URL slugs
47
47
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
49
51
fi
50
52
51
53
# Search built_pages for every entry in updated_pages and add to pages array when it is found
0 commit comments