Skip to content

Commit 50b602b

Browse files
committed
update error msg
1 parent ebe97cc commit 50b602b

File tree

1 file changed

+25
-5
lines changed

1 file changed

+25
-5
lines changed

scripts/check-asciidoctor-build.sh

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ set -e
55
# ensure asciidoctor is installed
66
if ! command -v asciidoctor &>/dev/null ;
77
then
8-
echo "Asciidoctor is not installed. Please install it and try again."
8+
echo "Asciidoctor is not installed. Please install it and try again. 👻"
99
exit 127
1010
fi
1111

@@ -36,18 +36,38 @@ check_updated_assemblies () {
3636
# don't validate the assembly if it is not in a topic map
3737
if grep -rq "$PAGE" --include "*.yml" _topic_maps ; then
3838
# validate the assembly
39-
echo "Validating $ASSEMBLY. Validation will fail with FAILED, ERROR, or WARNING messages..."
40-
asciidoctor "$ASSEMBLY" -a source-highlighter=rouge -a icons! -o /tmp/out.html -v --failure-level WARN --trace
39+
echo "Validating $ASSEMBLY ... 🚨"
40+
VALIDATION_ERROR=$(asciidoctor "$ASSEMBLY" -a source-highlighter=rouge -a icons! -o /tmp/out.html -v --failure-level WARN --trace)
41+
# check assemblies and fail if errors are reported
42+
if [[ -z "$VALIDATION_ERROR" ]];
43+
then
44+
echo "No errors found! ✅"
45+
fi
4146
else
42-
echo "$ASSEMBLY is not in a topic_map"
47+
echo "$ASSEMBLY is not in a topic_map, skipping validation... 😙"
4348
fi
4449
done
4550
}
4651

52+
update_log () {
53+
echo ""
54+
echo "************************************************************************"
55+
echo ""
56+
echo "Validating all AsciiDoc files that are included in the pull request. 🕵"
57+
echo "Other assemblies that include the modifed modules are also validated. 🙀"
58+
echo "This might include assemblies that are not in the pull request. 🤬"
59+
echo "Validation will fail with FAILED, ERROR, or WARNING messages. ❌"
60+
echo "Correct all reported AsciiDoc errors to pass the validation build. 🤟"
61+
echo ""
62+
echo "************************************************************************"
63+
echo ""
64+
}
65+
4766
# check assemblies and fail if errors are reported
4867
if [ -n "${FILES}" ] ;
4968
then
69+
update_log
5070
check_updated_assemblies
5171
else
52-
echo "No modified AsciiDoc files found."
72+
echo "No modified AsciiDoc files found! 🥳"
5373
fi

0 commit comments

Comments
 (0)