File tree 1 file changed +4
-4
lines changed 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 6
6
LINKCHECK=" $1 "
7
7
8
8
N_BROKEN=$( jq -r ' select(.status=="broken")' " $LINKCHECK " | jq -s length)
9
- N_REDIRECTED =$( jq -r ' select(.status=="redirected")' " $LINKCHECK " | jq -s length)
9
+ N_PERMANENT_REDIRECT =$( jq -r ' select(.status=="redirected")' " $LINKCHECK " | jq -s length)
10
10
11
11
# shellcheck disable=SC2086
12
12
if [[ $N_BROKEN -gt 0 ]]; then
@@ -15,9 +15,9 @@ if [[ $N_BROKEN -gt 0 ]]; then
15
15
fi
16
16
17
17
# shellcheck disable=SC2086
18
- if [[ $N_REDIRECTED -gt 0 ]]; then
19
- printf " \n\033[35;1m%s\033[0m\n" " Redirected links"
20
- jq -r ' select(.status=="redirected") | "\(.filename):\(.lineno) \(.uri)\n \(.code) \(.info)"' " $LINKCHECK "
18
+ if [[ $N_PERMANENT_REDIRECT -gt 0 ]]; then
19
+ printf " \n\033[35;1m%s\033[0m\n" " Permanently redirected links"
20
+ jq -r ' select(.status=="redirected" and .code==301 ) | "\(.filename):\(.lineno) \(.uri)\n \(.info)"' " $LINKCHECK "
21
21
fi
22
22
23
23
exit " $N_BROKEN "
You can’t perform that action at this time.
0 commit comments