#!/usr/bin/env bash # # Copyright (c) 2019 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # # Check wrong mediawiki link format ECODE=0 while IFS= read -r fname; do GRES=$(grep -nE '\]\((https?://|\.\./bip-|/bip-)' "$fname") if [ "$GRES" != "" ]; then if [ $ECODE -eq 0 ]; then >&2 echo "Github Mediawiki format writes links as [URL text], not as [text](URL):" fi ECODE=1 while IFS= read -r line; do echo "- ${fname#./}:$line" done <<< "$GRES" fi done < <(find . -type f -name '*.mediawiki' | sort) exit $ECODE