ci: Restore lychee link check. Only validate internal links (#32463)
Follow-up to: https://github.com/zed-industries/zed/pull/32460 Follow-up to: https://github.com/zed-industries/zed/pull/30844 Release Notes: - N/A
This commit is contained in:
parent
286b97c0de
commit
9c47c52de5
2 changed files with 32 additions and 1 deletions
|
@ -2,6 +2,31 @@
|
|||
|
||||
set -euo pipefail
|
||||
|
||||
usage() {
|
||||
echo "Usage: $0 [local|all] [--help]"
|
||||
echo " local Only check local links (default)"
|
||||
echo " all Check all links including remote ones"
|
||||
exit 1
|
||||
}
|
||||
|
||||
check_mode="local"
|
||||
if [ $# -eq 1 ]; then
|
||||
case "$1" in
|
||||
"local") check_mode="local" ;;
|
||||
"all") check_mode="all" ;;
|
||||
"--help") usage ;;
|
||||
*) echo "Invalid argument: $1" && usage ;;
|
||||
esac
|
||||
else
|
||||
usage
|
||||
fi
|
||||
|
||||
cargo install lychee
|
||||
cd "$(dirname "$0")/.."
|
||||
lychee --no-progress './docs/src/**/*'
|
||||
|
||||
if [ "$check_mode" = "all" ]; then
|
||||
lychee --no-progress './docs/src/**/*'
|
||||
else
|
||||
lychee --exclude '^http' './docs/src/**/*'
|
||||
fi
|
||||
#
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue