From b7c4d89004f6c493fc0acdbf8b26cae1857b4eb1 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Wed, 1 Nov 2023 22:45:27 +0100 Subject: fix typo --- bin/extra/supd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'bin/extra') diff --git a/bin/extra/supd b/bin/extra/supd index 61ea144..9adfcf6 100755 --- a/bin/extra/supd +++ b/bin/extra/supd @@ -27,7 +27,7 @@ do # 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' + awk -F '[][]' '/^\*/ {print $2}' | + sed 's/ahead/↑ /;s/behind/↓ /;s/[^↓↑]*/ /g')" ) done -- cgit v1.2.3 From e00713823b3dbd52f7ea15b5d7f7371d78142e16 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Wed, 1 Nov 2023 22:45:41 +0100 Subject: exit if command failed --- bin/extra/supd | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'bin/extra') diff --git a/bin/extra/supd b/bin/extra/supd index 9adfcf6..dba4910 100755 --- a/bin/extra/supd +++ b/bin/extra/supd @@ -19,11 +19,16 @@ 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 | -- cgit v1.2.3 From 5265e4a51c9b76537f6c7766e5edbb1f20e56da4 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Wed, 1 Nov 2023 22:47:04 +0100 Subject: put status in braces --- bin/extra/supd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'bin/extra') diff --git a/bin/extra/supd b/bin/extra/supd index dba4910..2e1f968 100755 --- a/bin/extra/supd +++ b/bin/extra/supd @@ -30,8 +30,8 @@ do 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 | + 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')" ) -- cgit v1.2.3