diff --git a/scripts/check_style.sh b/scripts/check_style.sh index c4df6eb98..b8033ea28 100755 --- a/scripts/check_style.sh +++ b/scripts/check_style.sh @@ -27,7 +27,7 @@ if [[ "$WHITESPACE" != "" ]] then echo "Error: Trailing whitespace found:" | tee -a "$ERROR_LOG" echo "$WHITESPACE" | tee -a "$ERROR_LOG" - scripts/post_style_errors_on_github.sh "$ERROR_LOG" + scripts/ci/post_style_errors_on_github.sh "$ERROR_LOG" exit 1 fi @@ -56,7 +56,7 @@ if [[ "$FORMATERROR" != "" ]] then echo "Coding style error:" | tee -a "$ERROR_LOG" echo "$FORMATERROR" | tee -a "$ERROR_LOG" - scripts/post_style_errors_on_github.sh "$ERROR_LOG" + scripts/ci/post_style_errors_on_github.sh "$ERROR_LOG" exit 1 fi ) diff --git a/scripts/ci/post_style_errors_on_github.sh b/scripts/ci/post_style_errors_on_github.sh index cfc0b5bf0..b0bf1bda7 100755 --- a/scripts/ci/post_style_errors_on_github.sh +++ b/scripts/ci/post_style_errors_on_github.sh @@ -4,10 +4,7 @@ ERROR_LOG="$1" function report_error_to_github { - if [[ $CIRCLE_PR_NUMBER != "" ]] - then - CIRCLE_PR_NUMBER="${CIRCLE_PULL_REQUEST//[^0-9]/}" - fi + [[ $CIRCLE_PR_NUMBER != "" ]] || CIRCLE_PR_NUMBER="${CIRCLE_PULL_REQUEST//[^0-9]/}" if [[ $CI == "true" ]] then