]> git.armaanb.net Git - bin.git/commitdiff
git-check: convert from bash to sh
authorArmaan Bhojwani <me@armaanb.net>
Tue, 1 Jun 2021 03:18:59 +0000 (23:18 -0400)
committerArmaan Bhojwani <me@armaanb.net>
Tue, 1 Jun 2021 03:42:40 +0000 (23:42 -0400)
git-check

index 3392bcb1b8e2d0fae64a4869d0e8494e2d68e943..852624d34be101201f31ad0be9030579599066a7 100755 (executable)
--- a/git-check
+++ b/git-check
@@ -1,14 +1,16 @@
-#!/usr/bin/env bash
+#!/usr/bin/env sh
 # Go into each subdirectory and run a git stat
 
 for i in ${1:-.}/*; do
-               if [[ -d $i/.git ]]; then
+               if [ -d $i/.git ]; then
                                stat=$(git -C $i diff --stat)
-                               if [[ -n $stat ]]; then
+                               if [ -n "$stat" ]; then
                                                echo $i
                                                chars=${#i}
-                                               for (( j = 0; j < $chars; j++ )); do
+                                               j=0;
+                                               while [ "$j" -le "$chars" ]; do
                                                                echo -n "="
+                                                               j=$(( j + 1 ))
                                                done
                                                echo
                                                git -C $i diff --stat