-
Notifications
You must be signed in to change notification settings - Fork 515
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
linkcheck only for changed files except in cron jobs
- Loading branch information
Showing
3 changed files
with
22 additions
and
1 deletion.
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
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
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/usr/bin/env bash | ||
|
||
if [ "$TRAVIS_EVENT_TYPE" = "cron" ] ; then # running in cron job | ||
FLAGS="" | ||
|
||
echo "Doing full link check." | ||
elif [ "$CI" = "true" ] ; then # running in PR CI build | ||
CHANGED_FILES=$(git diff --name-only $TRAVIS_COMMIT_RANGE | tr '\n' ' ') | ||
FLAGS="-f $CHANGED_FILES" | ||
|
||
echo "Checking files changed in $TRAVIS_COMMIT_RANGE: $CHANGED_FILES" | ||
else # running locally | ||
COMMIT_RANGE=master... | ||
CHANGED_FILES=$(git diff --name-only $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 |