forgejo-api-types/calc_stats.sh

9 lines
307 B
Bash
Raw Permalink Normal View History

2023-07-28 20:31:04 +01:00
ENUMERATOR=$(rg "to-todo" -c -I | paste -sd+ | bc)
DENOMINATOR=$(rg "pub mod" ./src/types/api/ -c -I | paste -sd+ | bc)
echo "$ENUMERATOR.0/$DENOMINATOR.0"
UNDONE=$(echo "scale=2; ($ENUMERATOR * 100)/$DENOMINATOR" | bc )
DONE=$(echo "scale=2; 100 - $UNDONE" | bc)
echo done: $DONE %
echo undone: $UNDONE %