File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed
Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ # Copyright (c) Meta Platforms, Inc. and affiliates.
3+ # All rights reserved.
4+ #
5+ # This source code is licensed under the BSD-style license found in the
6+ # LICENSE file in the root directory of this source tree.
7+
8+ set -euo pipefail
9+
10+ green=' \e[1;32m' ; red=' \e[1;31m' ; cyan=' \e[1;36m' ; yellow=' \e[1;33m' ; reset=' \e[0m'
11+ last= rc=0
12+ while IFS=: read -r f u; do
13+ if [ " $f " != " $last " ]; then
14+ [ -n " $last " ] && echo
15+ printf ' %s:\n' " $f "
16+ last=$f
17+ fi
18+ if curl --fail -s -m10 -o /dev/null " $u " ; then
19+ printf " ${green} [OK]${reset} ${cyan} %s${reset} \n" " $u "
20+ else
21+ printf " ${red} [FAIL]${reset} ${yellow} %s${reset} \n" " $u "
22+ rc=1
23+ fi
24+ done < <(
25+ git --no-pager grep --no-color -I -o -E ' https?://[^[:space:]<>\")\{]+' \
26+ -- ' *' \
27+ ' :(exclude).*' ' :(exclude)**/.*' ' :(exclude)**/*.lock' ' :(exclude)**/third-party/**' \
28+ | sed ' s/[."\’]$//'
29+ )
30+ exit $rc
You can’t perform that action at this time.
0 commit comments