summaryrefslogtreecommitdiff
path: root/bin/extra/supd
diff options
context:
space:
mode:
authorRaymaekers Luca <raymaekers.luca@gmail.com>2023-11-06 09:29:30 +0100
committerRaymaekers Luca <raymaekers.luca@gmail.com>2023-11-06 09:29:30 +0100
commit61d5bb429488794ac178a47fa73c38322aa14c04 (patch)
tree6cd7d3510f999701b5e2f7fe10b0f790cd868243 /bin/extra/supd
parentaf9608a3a98f0ab4217da80b8d478810505801bc (diff)
parent694813e05187b5ccf144425c4bad6f5ab4f92234 (diff)
Merge branch 'main' of db:dotfiles
Diffstat (limited to 'bin/extra/supd')
-rwxr-xr-xbin/extra/supd14
1 files changed, 7 insertions, 7 deletions
diff --git a/bin/extra/supd b/bin/extra/supd
index c7e4e8c..9a5ce0c 100755
--- a/bin/extra/supd
+++ b/bin/extra/supd
@@ -20,19 +20,19 @@ do
(
cd "$dir" || return
# is git dir
- git rev-parse > /dev/null 2>&1 || return
- printf '%s: ' "$dir" | >&2 sed "s#$HOME#~#"
- if git "${1:-fetch}" > /dev/null 2>&1
+ if ! git rev-parse > /dev/null 2>&1
then
- printf 'o'
- else
printf 'x\n'
- return
+ exit
fi
+ printf '%s: ' "$dir" | >&2 sed "s#$HOME#~#"
+ git "${1:-fetch}" > /dev/null 2>&1 &&
+ printf 'o' ||
+ printf 'x'
# 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')"
+ sed 's/ahead/↑ /;s/behind/↓ /;s/[^↓↑]*//g')"
)
done