From: Armaan Bhojwani Date: Tue, 1 Jun 2021 03:18:59 +0000 (-0400) Subject: git-check: convert from bash to sh X-Git-Url: http://git.armaanb.net/st/log/?p=bin.git;a=commitdiff_plain;h=864beaf66dfe57b6e2b83b86c868daee677ffda6 git-check: convert from bash to sh --- diff --git a/git-check b/git-check index 3392bcb..852624d 100755 --- 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