diff options
Diffstat (limited to 'tools/proof')
-rwxr-xr-x | tools/proof | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/tools/proof b/tools/proof new file mode 100755 index 00000000..c41745b6 --- /dev/null +++ b/tools/proof @@ -0,0 +1,32 @@ +#!/bin/bash + +set -e + +cd ~/src/ledger + +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* + +time ./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 + mv ~/Desktop/proof.log /tmp +fi + +exit 0 |