From 3b2226a87988231a7c09bff546aeb86f9d6cccd3 Mon Sep 17 00:00:00 2001 From: Nicolas Boisselier Date: Tue, 6 Dec 2016 20:45:18 +0000 Subject: [PATCH] nb_repos_status --- etc/profile.d/nb.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/etc/profile.d/nb.sh b/etc/profile.d/nb.sh index efb44230..e612d2d7 100644 --- a/etc/profile.d/nb.sh +++ b/etc/profile.d/nb.sh @@ -20,13 +20,14 @@ nb_repos_status() { shell_help "List repos git status" "$@" && return local status local pwd=`pwd` + local i for i in $(nb_repo); do cd "$i" || continue status=$(git status --short "$i"|sed 's/^/ /') - [ -z "$status" ] || status=$'\n'"$status" + [ -n "$status" ] && status=$'\n'"$status" - printf ">%s%s\n" "$i" "$status" + printf "%s %s\n" "$i" "$status" done cd "$pwd" } -- 2.47.3