forked from rust-lang/rustc-dev-guide
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix commit ranges, attempt rust-lang#2
- Loading branch information
Showing
1 changed file
with
10 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |