summaryrefslogtreecommitdiff
path: root/scripts/diffcheck.sh
blob: aa9f557cf2870fec97c6750fb6c97626ad7f517d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/bash

scripts/buildtable.pl >/tmp/table.mediawiki 2> /dev/null
diff README.mediawiki /tmp/table.mediawiki | grep '^[<>] |' >/tmp/after.diff || true
if git checkout HEAD^ && scripts/buildtable.pl >/tmp/table.mediawiki 2>/dev/null; then
    diff README.mediawiki /tmp/table.mediawiki | grep '^[<>] |' >/tmp/before.diff || true
    newdiff=$(diff -s /tmp/before.diff /tmp/after.diff -u | grep '^+')
    if [ -n "$newdiff" ]; then
        echo "$newdiff"
        exit 1
    fi
    echo "README table matches expected table from BIP files"
else
    echo 'Cannot build previous commit table for comparison'
    exit 1
fi