| 1 | #!/bin/shscip-shell filesystem . . `/bin/sh`. |
| 2 | |
| 3 | outfile="${1:-$GITHUB_STEP_SUMMARY}" |
| 4 | |
| 5 | # summarize coqc version to make it easier to read |
| 6 | COQC_VERSION_SHORT="$(coqc --print-version 2>/dev/nullscip-shell filesystem . . `/dev/null`. | cutscip-shell system . . cut. -d " " -f 1)" |
| 7 | COQC_VERSION="$(coqc --version 2>/dev/nullscip-shell filesystem . . `/dev/null`. | trscip-shell system . . tr. '\n' ',' | sedscip-shell system . . sed. 's/,$//g')" |
| 8 | COQTOP_VERSION="$(coqtop </dev/nullscip-shell filesystem . . `/dev/null`. 2>&1)" |
| 9 | if [scip-shell system . . `[`. ! -z "$outfile" ]; then |
| 10 | if [scip-shell system . . `[`. ! -z "$COQC_VERSION" ]; then |
| 11 | echoscip-shell system . . echo. "Writing $COQC_VERSION to $outfile..." |
| 12 | printfscip-shell system . . printf. '%s\n\n' "<details><summary>${COQC_VERSION}</summary>" >> "$outfile" |
| 13 | printfscip-shell system . . printf. '%s\n' '```' >> "$outfile" |
| 14 | printfscip-shell system . . printf. '%s\n' "${COQTOP_VERSION}" >> "$outfile" |
| 15 | printfscip-shell system . . printf. '%s\n%s\n' '```' '</details>' >> "$outfile" |
| 16 | else |
| 17 | echoscip-shell system . . echo. "Not writing missing coqc version to $outfile" |
| 18 | fi |
| 19 | else |
| 20 | echoscip-shell system . . echo. "GITHUB_STEP_SUMMARY is unset" |
| 21 | fi |