Commit d7b881d2 by Mislav Marohnić

Fix `script/test` in a non-Travis environment

`script/test` will now only attempt to call `script/mirror` if either
TRAVIS_PULL_REQUEST or TRAVIS_COMMIT_RANGE is set.
parent 19a59f42
...@@ -6,14 +6,14 @@ set -e ...@@ -6,14 +6,14 @@ set -e
STATUS=0 STATUS=0
bats -t test || STATUS="$?" bats -t test || STATUS="$?"
if [ "$TRAVIS_PULL_REQUEST" != "false" ] && [ -z "$TRAVIS_COMMIT_RANGE" ]; then if [ "${TRAVIS_PULL_REQUEST:-false}" != "false" ] && [ -z "$TRAVIS_COMMIT_RANGE" ]; then
first_sha="$(curl -fsSL https://github.com/${TRAVIS_REPO_SLUG}/pull/${TRAVIS_PULL_REQUEST}.patch | head -1 | awk '{print $2}')" first_sha="$(curl -fsSL https://github.com/${TRAVIS_REPO_SLUG}/pull/${TRAVIS_PULL_REQUEST}.patch | head -1 | awk '{print $2}')"
export TRAVIS_COMMIT_RANGE="${first_sha}^..${TRAVIS_COMMIT}" export TRAVIS_COMMIT_RANGE="${first_sha}^..${TRAVIS_COMMIT}"
fi fi
if [ "$TRAVIS_SECURE_ENV_VARS" = "true" ]; then if [ "$TRAVIS_SECURE_ENV_VARS" = "true" ]; then
./script/mirror update "$TRAVIS_COMMIT_RANGE" ./script/mirror update "$TRAVIS_COMMIT_RANGE"
elif [ "$TRAVIS_PULL_REQUEST" != "false" ]; then elif [ "${TRAVIS_PULL_REQUEST:-false}" != "false" ]; then
./script/mirror verify "$TRAVIS_COMMIT_RANGE" ./script/mirror verify "$TRAVIS_COMMIT_RANGE"
fi fi
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment