forgejo-api-types/calc_stats.sh
2023-07-28 21:31:04 +02:00

8 lines
307 B
Bash

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 %