#!/usr/bin/env bash
#
# Update vim plugins in $HOME/.vim/pack/git-plugins/opt

set -e

pluginhome=$HOME/.vim/pack/git-plugins
cd "$pluginhome"

find . -mindepth 2 -maxdepth 2 -type d -print0 | while read -rd $'\0' pluginpath
do
  cd "$pluginpath"
  basename=$(basename "$pluginpath")
  printf "In %s.. " "$basename"
  git pull --rebase
  cd "$pluginhome"
done