From 7b4417673fe766a4264db404d1830f692afa7d9b Mon Sep 17 00:00:00 2001 From: fdai7451 Date: Mon, 16 Jan 2023 22:57:10 +0100 Subject: [PATCH] chore: add count commit script --- count-commits.sh | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100755 count-commits.sh diff --git a/count-commits.sh b/count-commits.sh new file mode 100755 index 0000000..ee0657c --- /dev/null +++ b/count-commits.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +total_commits=$(git shortlog -s -n | awk '{ sum += $1; } END { print sum; }' "$@") + +if [[ $total_commits -gt 200 ]]; then + echo "Total commits: $total_commits. Minimum required commits reached!" +else + echo "Total commits: $total_commits. $(expr 200 - $total_commits) commits left to reach minimum required commits" +fi