diff --git a/scripts/category-count b/scripts/category-count new file mode 100755 index 0000000..2c5d296 --- /dev/null +++ b/scripts/category-count @@ -0,0 +1,24 @@ +#!/usr/bin/env zsh +# Script to fetch commit messages and display the category frequencies. +# Example: +# 047c36c [Meta] Added README. +# 5b16912 [Init] Added scripts. +# +# Will output: +# Meta: 1 +# Init: 1 +# +# Authored by: +# Alyxia Sother +# Mijyuoon + +data=$(git log --oneline | awk -F '[][]' '{for (i=2; i<=NF; i+=2) {printf "%s ", $i}; print ""}') +keys=$(echo "$data" | sort -u | uniq) + +for type in $data; do + eval "count_$type="'$'"((count_$type+1))" +done + +for type in $keys; do + echo "$type: $(eval "echo "'$'"count_$type")" +done