From ca38d242137374d056dff489a2995a0c682ff634 Mon Sep 17 00:00:00 2001 From: Donald Stufft Date: Mon, 30 Jun 2014 23:42:58 -0400 Subject: [PATCH] Protect against coverage files not existing --- .travis/run.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.travis/run.sh b/.travis/run.sh index 652fdea0a..e4585f01e 100755 --- a/.travis/run.sh +++ b/.travis/run.sh @@ -25,10 +25,16 @@ if [[ $TRAVIS_PULL_REQUEST != "false" ]] then # If this is a pull request then run our diff-cover to get the difference # in coverage that this PR introduces - git fetch origin $TRAVIS_BRANCH:refs/remotes/origin/$TRAVIS_BRANCH - diff-cover --compare-branch=origin/$TRAVIS_BRANCH coverage.xml + if [ -f coverage.xml ] + then + git fetch origin $TRAVIS_BRANCH:refs/remotes/origin/$TRAVIS_BRANCH + diff-cover --compare-branch=origin/$TRAVIS_BRANCH coverage.xml + fi else # If this is not a PR, but is being run against a branch, then just report # the coverage results for the entire code base. - coverage report -m + if [ -f .coverage ] + then + coverage report -m + fi fi -- GitLab