Skip to content

Commit 5238cfb

Browse files
committed
Update check asciiDoctor logic
1 parent 6565ace commit 5238cfb

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

scripts/check-asciidoctor-build.sh

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,33 +33,33 @@ check_updated_assemblies () {
3333
# concatenate both lists and remove dupe entries
3434
ALL_ASSEMBLIES=$(echo "$UPDATED_ASSEMBLIES $ASSEMBLIES" | tr ' ' '\n' | sort -u)
3535
# check that assemblies are in a topic_map
36-
for ASSEMBLY in $ALL_ASSEMBLIES; do
36+
for ASSEMBLY in ${ALL_ASSEMBLIES}; do
3737
# get the page name to search the topic_map
3838
# search for files only, not folders
3939
PAGE="File: $(basename "$ASSEMBLY" .adoc)"
4040
# don't validate the assembly if it is not in a topic map
4141
if grep -rq "$PAGE" --include "*.yml" _topic_maps ; then
4242
# validate the assembly
43-
echo "Validating $ASSEMBLY ... 🚨"
43+
echo "Validating $ASSEMBLY ..."
4444
RED='\033[0;31m'
4545
NC='\033[0m'
4646
OUTPUT=$(asciidoctor "$ASSEMBLY" -a source-highlighter=rouge -a icons! -o /tmp/out.html -v --failure-level WARN --trace 2>&1)
47-
4847
# check assemblies and fail if errors are reported
4948
if [[ $? != 0 ]];
5049
then
5150
echo -e "${RED}$OUTPUT${NC}"
52-
echo "Validation errors found! ❌"
53-
exit 1
51+
ERRORS=true
5452
else
55-
echo "No errors found! ✅"
56-
exit 0
53+
echo "No errors found for $ASSEMBLY! ✅"
5754
fi
5855
else
5956
echo "$ASSEMBLY is not in a topic_map, skipping validation... 😙"
60-
exit 0
6157
fi
6258
done
59+
if [ "$ERRORS" = true ]; then
60+
echo "Validation errors found! ❌"
61+
exit 1
62+
fi
6363
}
6464

6565
update_log () {

0 commit comments

Comments
 (0)