markdown-link-check-with-retry.sh 411 B

1234567891011121314151617
  1. #!/bin/bash -e
  2. # this script helps to reduce sporadic link check failures by retrying at a file-by-file level
  3. retry_count=3
  4. for file in "$@"; do
  5. for i in $(seq 1 $retry_count); do
  6. if markdown-link-check --config "$(dirname "$0")/markdown-link-check-config.json" \
  7. "$file"; then
  8. break
  9. elif [[ $i -eq $retry_count ]]; then
  10. exit 1
  11. fi
  12. sleep 5
  13. done
  14. done