summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorRaymaekers Luca <raymaekers.luca@gmail.com>2023-11-01 22:47:27 +0100
committerRaymaekers Luca <raymaekers.luca@gmail.com>2023-11-01 22:47:27 +0100
commite8fe4ff2bf93e8df6fd811f304edd20ff26b5c33 (patch)
tree0f19d06565e978d6833ef0e73b4df89f2dbc1b6b /bin
parent6113f6739e5049dc3c6309f1a5a3f19cfc1a0ee7 (diff)
parent5265e4a51c9b76537f6c7766e5edbb1f20e56da4 (diff)
Merge branch 'main' of db:dotfiles
Diffstat (limited to 'bin')
-rwxr-xr-xbin/extra/supd17
1 files changed, 11 insertions, 6 deletions
diff --git a/bin/extra/supd b/bin/extra/supd
index 61ea144..2e1f968 100755
--- a/bin/extra/supd
+++ b/bin/extra/supd
@@ -19,15 +19,20 @@ for dir in $dirs
do
(
cd "$dir" || return
+ # is git dir
git rev-parse > /dev/null 2>&1 || return
printf '%s:' "$dir" | >&2 sed "s#$HOME#~#"
- git "${1:-fetch}" > /dev/null 2>&1 &&
- printf ' o' ||
+ if git "${1:-fetch}" > /dev/null 2>&1
+ then
+ printf ' o'
+ else
printf ' x'
+ return
+ fi
# Show remote state
- printf '%s %s\n' "$(git status --short 2> /dev/null |
- awk 'NR==1 {print $1}')" "$(git branch -v 2>/dev/null |
- awk -F '[][]' '/^\*/ {print $2}')" |
- sed 's/ahead/↑ /;s/behind/↓ /;s/[^↓↑]*/ /g'
+ printf ' %s %s\n' "$(git status --short 2> /dev/null |
+ awk 'NR==1 {print "(" $1 ")"}')" "$(git branch -v 2>/dev/null |
+ awk -F '[][]' '/^\*/ {print $2}' |
+ sed 's/ahead/↑ /;s/behind/↓ /;s/[^↓↑]*/ /g')"
)
done