diff options
author | Raymaekers Luca <raymaekers.luca@gmail.com> | 2023-11-01 22:45:41 +0100 |
---|---|---|
committer | Raymaekers Luca <raymaekers.luca@gmail.com> | 2023-11-01 22:45:41 +0100 |
commit | e00713823b3dbd52f7ea15b5d7f7371d78142e16 (patch) | |
tree | cb893b23ce421da05ec815eddaef3179fc0532b1 /bin | |
parent | b7c4d89004f6c493fc0acdbf8b26cae1857b4eb1 (diff) |
exit if command failed
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/extra/supd | 9 |
1 files changed, 7 insertions, 2 deletions
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 | |