#!/bin/bash
# usage: export.sh <edition> ; exports the five theorems (sandboxed, offline) and hashes the result
E=$1; S=/home/claude/grh/short; L=$S/logs
echo "export start $(date -u +%FT%TZ)" > $L/$E.export.timeline
/usr/bin/time -v $S/tools/sbx.sh $S/$E sh -c 'ulimit -s unlimited; lake env leanexport Main -- riemannHypothesis riemannZeta_eq_zero_re LFunction_ne_zero_of_half_lt_re LFunction_eq_zero_re LFunction_eq_zero_re_of_isPrimitive > .lake/solution.ndjson' > $L/$E.export.log 2>&1
echo "export exit=$? $(date -u +%FT%TZ) bytes=$(stat -c %s $S/$E/.lake/solution.ndjson) sha256=$(sha256sum $S/$E/.lake/solution.ndjson | cut -d' ' -f1)" >> $L/$E.export.timeline
