From 50140460510749b98e48471855822ac78bcacedd Mon Sep 17 00:00:00 2001 From: Evgeniy Sokolov Date: Sat, 5 May 2018 22:14:10 +0200 Subject: [PATCH] fix exit code --- files/check.sh | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/files/check.sh b/files/check.sh index dee4b7c..57b162d 100644 --- a/files/check.sh +++ b/files/check.sh @@ -32,13 +32,12 @@ curl -s https://api.github.com/repos/$TRAVIS_REPO_SLUG/pulls/$TRAVIS_PULL_REQUES github_comments_diff -comments /tmp/comments.json -exists-comments /tmp/pr_comments.json > /tmp/send_comments.json OUTPUT=$(cat /tmp/comments.json | (! grep .)); -OUTPUT_EXIT_CODE=$? +EXIT_CODE=$? -if [ $OUTPUT_EXIT_CODE -ne 0 ]; then - cat /tmp/send_comments.json - echo $TRAVIS_REPO_SLUG $TRAVIS_PULL_REQUEST +if [ $EXIT_CODE -ne 0 ]; then github_comments_send -file /tmp/send_comments.json -repo $TRAVIS_REPO_SLUG -pr $TRAVIS_PULL_REQUEST - EXIT_CODE=1 fi +cat /tmp/comments.json + exit $EXIT_CODE