diff options
author | Raymaekers Luca <raymaekers.luca@gmail.com> | 2024-07-11 21:48:56 +0200 |
---|---|---|
committer | Raymaekers Luca <raymaekers.luca@gmail.com> | 2024-07-11 21:48:56 +0200 |
commit | a857f247d9a71b88a4f0dbcfa95e3679e8456e70 (patch) | |
tree | 846ddcd8117be1505a970e3638fc65d0ec954a2e /bin/common/gt-st | |
parent | 75196520b3d6a0e60db1d03a64aaa0655cc4f202 (diff) | |
parent | 6251d6ba1054cd79387f0f88ce25d2f4bc8b78c4 (diff) |
Merge branch 'main' of debuc.com:dotfiles
Diffstat (limited to 'bin/common/gt-st')
-rwxr-xr-x | bin/common/gt-st | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/bin/common/gt-st b/bin/common/gt-st index 98184b9..43443cd 100755 --- a/bin/common/gt-st +++ b/bin/common/gt-st @@ -14,11 +14,15 @@ if [ ! -d "$repo" ]; then fi # replace line with status -status="$(git -C "$repo" status --porcelain 2>/dev/null | +status="$(git -C "$repo" status --porcelain 2>/dev/null | awk '{print $1}' | sort | uniq | tr -s '?' | tr -d '\n')" remote="$(git -C "$repo" branch -v 2>/dev/null | sed '/^*/!d;s/ahead/↑/;s/behind/↓/;s/[^↓↑]*//g')" -printf '%s %s %s\n' "$repo_pretty" "$status" "$remote" +if [ "$status" ] || [ "$remote" ]; then + printf '%s: \033[0;31m%s %s\033[0m\n' "$repo_pretty" "$status" "$remote" +else + printf '%s\n' "$repo_pretty" +fi |