From c8256431488422380e19891f5ef667c9f973c005 Mon Sep 17 00:00:00 2001 From: murgi Date: Tue, 5 Aug 2025 14:34:08 +0200 Subject: [PATCH] [ZSH] Fix autopull --- zsh/.zshrc | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/zsh/.zshrc b/zsh/.zshrc index 5972733..de5c06a 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -19,16 +19,15 @@ if [[ -f ~/.zsh/.shared_config ]] ; then touch ~/.config/nvim/.shared_config fi -function update_dotfiles () { - cd ~/dotfiles - fetch=$(git fetch) - if [[ -n "$fetch" ]]; then - git pull 2>& 1 > /dev/null +update_dotfiles() { + cd ~/dotfiles || return + if git fetch --dry-run 2>&1 | grep -q .; then + git pull > /dev/null 2>&1 fi } -if [ $shared_config -eq 0 ]; then - update_dotfiles &| +if [ "$shared_config" -eq 0 ]; then + update_dotfiles 2>&1 &! fi