Skip to content

Commit

Permalink
fix commit ranges, attempt rust-lang#2
Browse files Browse the repository at this point in the history
  • Loading branch information
mark-i-m committed Oct 7, 2020
1 parent 5659e32 commit 20490d5
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions ci/linkcheck.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
#!/usr/bin/env bash

if [ "$TRAVIS_EVENT_TYPE" = "cron" ] ; then
if [ "$TRAVIS_EVENT_TYPE" = "cron" ] ; then # running in cron job
FLAGS=""

echo "Doing full link check."
else
CHANGED_FILES=$(git diff-tree --no-commit-id --name-only -r origin/master... | tr '\n' ' ')
elif [ "$CI" = "true" ] ; then # running in PR CI build
CHANGED_FILES=$(git diff-tree --no-commit-id --name-only -r $TRAVIS_COMMIT_RANGE | tr '\n' ' ')
FLAGS="-f $CHANGED_FILES"

echo "Checking files changed in origin/master...: $CHANGED_FILES"
echo "Checking files changed in $TRAVIS_COMMIT_RANGE: $CHANGED_FILES"
else # running locally
COMMIT_RANGE=master..
CHANGED_FILES=$(git diff-tree --no-commit-id --name-only -r $COMMIT_RANGE | tr '\n' ' ')
FLAGS="-f $CHANGED_FILES"

echo "Checking files changed in $COMMIT_RANGE: $CHANGED_FILES"
fi

exec mdbook-linkcheck $FLAGS -- $TRAVIS_BUILD_DIR

0 comments on commit 20490d5

Please sign in to comment.