From 6251d6ba1054cd79387f0f88ce25d2f4bc8b78c4 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Thu, 11 Jul 2024 21:42:14 +0200 Subject: checkpoint --- bin/common/gt-st | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'bin/common/gt-st') 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 -- cgit v1.2.3