From 17eb78aa6313d2fdf62ca4e59c9e91e6ae4f517b Mon Sep 17 00:00:00 2001 From: Akos Kiss Date: Thu, 9 Aug 2018 10:26:09 +0200 Subject: [PATCH] Don't use a shell variable to store error output of doxygen (#2455) Storing the error output of doxygen into a shell variable first and echoing it later is error prone. In case of a long error output, the whole shell will crash before being able to print the doxygen diagnostics at all. This patch rewrites the check script to tee the diagnostics (pipe them to console and store them to a file at the same time) and check the output file size at the end. JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu --- tools/check-doxygen.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tools/check-doxygen.sh b/tools/check-doxygen.sh index ad1594c1c..dbc353ca2 100755 --- a/tools/check-doxygen.sh +++ b/tools/check-doxygen.sh @@ -14,12 +14,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -echo -n "Generating documentation with doxygen ..." -DOXYGEN_WARNINGS=$((doxygen > /dev/null) 2>&1) -echo " finished" - -if [ -n "$DOXYGEN_WARNINGS" ] +doxygen 2>&1 >/dev/null | head -n 1000 | tee doxygen.log +if [ -s doxygen.log ] then - echo "$DOXYGEN_WARNINGS" - exit 1 + EXIT=1 +else + EXIT=0 fi +rm -f doxygen.log +exit $EXIT