if [ $(which brew) ]; then
  let head_age=`/usr/bin/stat -f "%m" $ZSH/.git/FETCH_HEAD 2> /dev/null || echo 0`
  let repo_age=`date +"%s"`-$head_age
  let grace_period="86400" # 86400 = 24 hours
  if [ "$repo_age" -gt "$grace_period" ]; then
    echo "ZSH repo is out of date (older than $grace_period seconds)... updating"
    brew update
  fi
fi

if [ $ZSH ]; then
  let head_age=`/usr/bin/stat -f "%m" $ZSH/.git/FETCH_HEAD 2> /dev/null || echo 0`
  let repo_age=`date +"%s"`-$head_age
  let grace_period="86400" # 86400 = 24 hours
  if [ "$repo_age" -gt "$grace_period" ]; then
    echo "ZSH repo is out of date (older than $grace_period seconds)... updating"
    pushd $ZSH
    git pull --prune
    popd
  fi
fi

Fix ZSH repo checks and actually update the correct repo 😔
fix(ZSH): Fix ZSH repo checks and actually update the correct repo 😔
