From: Nicolas Boisselier Date: Tue, 6 Dec 2016 20:45:18 +0000 (+0000) Subject: nb_repos_status X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=3b2226a87988231a7c09bff546aeb86f9d6cccd3;p=nb.git nb_repos_status --- 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" }