]> git.armaanb.net Git - bin.git/commitdiff
git-check: cleanup
authorArmaan Bhojwani <me@armaanb.net>
Sun, 30 May 2021 04:38:22 +0000 (00:38 -0400)
committerArmaan Bhojwani <me@armaanb.net>
Sun, 30 May 2021 04:43:49 +0000 (00:43 -0400)
git-check

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