Commit ce90f0d0 by Marcus Shawcroft Committed by Tianqi Chen

[CI] Fix shell script exit codes (#3329)

The exist code of a posix compilant shell is 0..255.  Attempting to
return -1 will error in some shells and implicitly cast to 255 in
others.  Fix it by returning a legal return value.
parent 474b5683
...@@ -41,7 +41,7 @@ if grep --quiet -E "File" /tmp/$$.apache-rat.txt; then ...@@ -41,7 +41,7 @@ if grep --quiet -E "File" /tmp/$$.apache-rat.txt; then
echo "- Create file_list.txt in your text editor" echo "- Create file_list.txt in your text editor"
echo "- Copy paste the above content in file-list into file_list.txt" echo "- Copy paste the above content in file-list into file_list.txt"
echo "- python3 tests/lint/add_asf_header.py file_list.txt" echo "- python3 tests/lint/add_asf_header.py file_list.txt"
exit -1 exit 1
fi fi
echo "Check codestyle of c++ code..." echo "Check codestyle of c++ code..."
...@@ -59,5 +59,5 @@ echo "---------Error Log----------" ...@@ -59,5 +59,5 @@ echo "---------Error Log----------"
cat /tmp/$$.logclean.txt cat /tmp/$$.logclean.txt
echo "----------------------------" echo "----------------------------"
if grep --quiet -E "warning|error" < /tmp/$$.logclean.txt; then if grep --quiet -E "warning|error" < /tmp/$$.logclean.txt; then
exit -1 exit 1
fi fi
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment