Skip to content

Commit 2aeee17

Browse files
authored
Merge pull request #68798 from aireilly/update-script
update script for running in alpine container
2 parents 537fdcb + 0e7c1b6 commit 2aeee17

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

scripts/get-updated-distros.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#!/bin/bash
2-
32
# Returns a list of updated _topic_map.yml files.
43
# The list includes any topic maps that are themselves modified, and indirectly modifed topic maps where incldued AsciiDoc files have been updated.
54

@@ -12,12 +11,12 @@ REPO_PATH=$(git rev-parse --show-toplevel)
1211
DISTROS=()
1312

1413
# Get the modules in the PR, search for assemblies that include them, and concat with any updated assemblies files
15-
1614
MODULES=$(echo "$FILES" | awk '/modules\/(.*)\.adoc/')
1715
if [ "${MODULES}" ]
1816
then
1917
# $UPDATED_ASSEMBLIES is the list of assemblies that contains changed modules
20-
UPDATED_ASSEMBLIES=$(grep -rnwl "$REPO_PATH" --include=\*.adoc --exclude-dir={snippets,modules} -e "$MODULES")
18+
UPDATED_ASSEMBLIES=$(grep -rnwL "$REPO_PATH" --exclude-dir={snippets,modules} -e "$MODULES" -- "*.adoc")
19+
2120
# Exit 0 if there are no modified assemblies
2221
if [[ -z "${UPDATED_ASSEMBLIES}" ]]
2322
then
@@ -26,6 +25,7 @@ then
2625
# Subtract $REPO_PATH from path with bash substring replacement
2726
UPDATED_ASSEMBLIES=${UPDATED_ASSEMBLIES//"$REPO_PATH/"/}
2827
fi
28+
2929
# ASSEMBLIES is the list of modifed assemblies
3030
ASSEMBLIES=$(echo "$FILES" | awk '!/modules\/(.*)\.adoc/')
3131
# Concatenate both lists and remove dupe entries
@@ -36,8 +36,8 @@ for ASSEMBLY in $ALL_ASSEMBLIES; do
3636
# Search for files only, not folders
3737
PAGE="File: $(basename "$ASSEMBLY" .adoc)"
3838
# Don't include the assembly if it is not in a topic map
39-
if grep -rq "$PAGE" --include "*.yml" _topic_maps ; then
40-
DISTROS+=("$(grep -rl "$PAGE" --include "*.yml" _topic_maps)")
39+
if grep -rq "$PAGE" _topic_maps/*.yml; then
40+
DISTROS+=("$(grep -rl "$PAGE" _topic_maps/*.yml)")
4141
fi
4242
done
4343

0 commit comments

Comments
 (0)