summaryrefslogtreecommitdiff
path: root/tools/proof
blob: 0509c57e72f38f1d5510c9a61b1b65c8017ee36f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/bash

set -e

VERSION=$(git describe --all --long)

if [[ -f ~/Products/last-proofed && \
      $(< ~/Products/last-proofed) = $VERSION ]]; then
    echo "No need to run tools/proof again"
    exit 0
fi

rm -fr ~/Products/ledger*

./acprep -j16 --warn proof 2>&1 | tee ~/Desktop/proof.log

if egrep -q '(ERROR|CRITICAL)' ~/Desktop/proof.log; then
    if [[ "$1" = "--alert" ]]; then
	notify "Ledger proof build FAILED"
    else
	echo "Ledger proof build FAILED"
	exit 1
    fi
else
    echo "Ledger proof build succeeded"
    echo $VERSION > ~/Products/last-proofed
fi

exit 0