From 30eafb1132d356789ef3e7f2b5544c5979897aed Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Mon, 9 May 2016 01:05:53 +0200 Subject: [PATCH] travis-apidoc.sh: add `|| true` to grep calls (#887) This made the apidoc script stop before the merge/push. This also adds "EXIT CODE" information in case there is a non-zero exit. --- build-utils/travis-apidoc.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/build-utils/travis-apidoc.sh b/build-utils/travis-apidoc.sh index 2e884b70..ee5a3e1a 100755 --- a/build-utils/travis-apidoc.sh +++ b/build-utils/travis-apidoc.sh @@ -21,6 +21,9 @@ fi set -e set +x +# Display exit code in term of failure (probably due to 'set -x'). +trap '[ "$?" = 0 ] || echo "EXIT CODE: $?"' EXIT + REPO_APIDOC="https://${GH_APIDOC_TOKEN}@github.com/awesomeWM/apidoc" REPO_DIR="$PWD" @@ -97,13 +100,13 @@ if [ "$TRAVIS_PULL_REQUEST" != false ]; then MERGE_COMMIT_MSG="$COMMIT_MSG Pull request: https://github.com/awesomeWM/awesome/pull/${TRAVIS_PULL_REQUEST}" else - PR_OR_ISSUE="$(echo "$COMMIT_MSG" | head -n 1 | grep -o '#[0-9]\+')" + PR_OR_ISSUE="$(echo "$COMMIT_MSG" | head -n 1 | grep -o '#[0-9]\+' || true)" if [ -n "$PR_OR_ISSUE" ]; then MERGE_COMMIT_MSG="$COMMIT_MSG Ref: https://github.com/awesomeWM/awesome/pull/${PR_OR_ISSUE}" else PR_OR_ISSUE_URL="$(echo "$COMMIT_MSG" \ - | grep -Eo 'https://github.com/awesomeWM/awesome/(issues|pull)/[0-9]+')" + | grep -Eo 'https://github.com/awesomeWM/awesome/(issues|pull)/[0-9]+' || true)" if [ -n "$PR_OR_ISSUE_URL" ]; then MERGE_COMMIT_MSG="$COMMIT_MSG Ref: $PR_OR_ISSUE_URL"