summaryrefslogtreecommitdiff
path: root/script
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2016-10-31 15:55:46 +0100
committerPatrick Steinhardt <ps@pks.im>2016-10-31 16:01:10 +0100
commit18c18e3df86850f794dd2fe562ea03a2beab244e (patch)
tree0d3568fcf578693c1014c01715c21c15dc89d180 /script
parent561276eed6be2c763af23ae3b034a1f194b03d0b (diff)
downloadlibgit2-18c18e3df86850f794dd2fe562ea03a2beab244e.tar.gz
coverity: check for Coverity token only if necessary
When running a Coverity build, we have to provide an authentication token in order to proof that we are actually allowed to run analysis in the name of a certain project. As this token should be secret, it is only set on the main repository, so when we were requested to run the Coverity script on another repository we do error out. But in fact we do also error out if the Coverity analysis should _not_ be run if there is no authentication token provided. Fix the issue by only checking for the authentication token after determining if analysis is indeed requested.
Diffstat (limited to 'script')
-rwxr-xr-xscript/coverity.sh6
1 files changed, 3 insertions, 3 deletions
diff --git a/script/coverity.sh b/script/coverity.sh
index 9021b9e7c..5fe16c031 100755
--- a/script/coverity.sh
+++ b/script/coverity.sh
@@ -1,9 +1,6 @@
#!/bin/bash
set -e
-# Environment check
-[ -z "$COVERITY_TOKEN" ] && echo "Need to set a coverity token" && exit 1
-
# Only run this on our branches
echo "Branch: $TRAVIS_BRANCH | Pull request: $TRAVIS_PULL_REQUEST | Slug: $TRAVIS_REPO_SLUG"
if [ "$TRAVIS_BRANCH" != "master" -o "$TRAVIS_PULL_REQUEST" != "false" -o "$TRAVIS_REPO_SLUG" != "libgit2/libgit2" ];
@@ -12,6 +9,9 @@ then
exit 0
fi
+# Environment check
+[ -z "$COVERITY_TOKEN" ] && echo "Need to set a coverity token" && exit 1
+
case $(uname -m) in
i?86) BITS=32 ;;
amd64|x86_64) BITS=64 ;;