make shell scripts more POSIX-compatible, and use tabs instead of spaces

This commit is contained in:
2025-07-21 12:49:11 +02:00
parent aefe0e6dce
commit 9b51e31f1a
11 changed files with 25 additions and 30 deletions

View File

@@ -1,17 +1,11 @@
#!/bin/bash
#!/usr/bin/sh
if [ -z ${1+x} ]; then
echo -e "\033[91mdidn't include a file exstension. (eg. \".cs\")"
exit -1
printf "\033[91mdidn't include a file exstension. (eg. \".cs\")\n"
exit 1
fi
# get all the files with the file extension
git ls-files | grep -E ".*\\$1" |
# run git blame on each file, which shows the commit for each line
xargs -n 1 git blame --line-porcelain |
# aquire the authors of this output and sort it
grep "^author " | sort |
# count all the unique authors and sort by number
uniq -c | sort -nr
xargs -n 1 git blame --line-porcelain | # run git blame on each file, which shows the commit for each line
grep "^author " | sort | # aquire the authors of this output and sort it
uniq -c | sort -nr # count all the unique authors and sort by number