diff options
author | Raymaekers Luca <raymaekers.luca@gmail.com> | 2023-07-15 23:18:49 +0200 |
---|---|---|
committer | Raymaekers Luca <raymaekers.luca@gmail.com> | 2023-07-15 23:18:49 +0200 |
commit | 8c22e3212086a89990a3709c78c3eb5ca92a7b2e (patch) | |
tree | 737072b2b5308f4e678299440d6fc007939da77e /config/essentials | |
parent | 0bdd5288aed359f0ed1f4401c08afc1f7868b997 (diff) | |
parent | 0b7195aab3e729f2b577545b3485dfe1193fd046 (diff) |
Merge branch 'main' of db:dotfiles
Diffstat (limited to 'config/essentials')
-rw-r--r-- | config/essentials/zsh/functions.zsh | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/config/essentials/zsh/functions.zsh b/config/essentials/zsh/functions.zsh index 188b405..fae05d6 100644 --- a/config/essentials/zsh/functions.zsh +++ b/config/essentials/zsh/functions.zsh @@ -111,18 +111,19 @@ upfile () { sgd () { d="$PWD" - for dir in ${1:-$HOME/src/*} - do - cd $dir + find $HOME/src -maxdepth 1 -mindepth 1 -type d | + while read -r dir + do + cd "$dir" + git status > /dev/null 2>&1 || continue git fetch > /dev/null 2>&1 - if [ "$(git status --short 2>/dev/null | grep -v "??" | head -1)" ] - then - # There are changes, and this is a git repo - echo "$PWD \e[1;31m*changes\e[0m" - fi + printf "$PWD" + test "$(git status --short 2>/dev/null | grep -v "??" | head -1)" && + printf " \e[1;31m*changes\e[0m" | sed "s#$HOME#~#" >&2 test "$(parse_git_remote)" && - echo "$PWD \e[0;32m*push/pull\e[0m" - done + printf " \e[0;32m*push/pull\e[0m" | sed "s#$HOME#~#" >&2 + printf "\n" + done cd "$d" unset d } |