Skip to content

Commit 1eba9d6

Browse files
committed
Ensure script exits with non-zero exit code on error
1 parent 65db7ce commit 1eba9d6

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

documentation/create_docs.sh

+5-1
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ rm -rf build
88

99
echo "Creating docs"
1010
xsltproc --xinclude xsl/proteus_php.xsl proteus_doc.xml
11+
exit_code=$? # Capture the exit code
1112

12-
if [ "$?" == "0" ]; then
13+
if [ "$exit_code" == "0" ]; then
1314
echo "Successfully created documentation"
1415
echo "Removing $path"
1516
rm -rf $path
@@ -24,3 +25,6 @@ if [ "$?" == "0" ]; then
2425
else
2526
echo "Failed creating documentation"
2627
fi
28+
29+
# Output exit code
30+
exit $exit_code

0 commit comments

Comments
 (0)