From cb388eb3e188d10b3c8393bee36d00177f334406 Mon Sep 17 00:00:00 2001 From: Kevin Date: Mon, 7 Apr 2014 19:16:58 -0400 Subject: [PATCH] The update script now runs the pathogen command that consolidates the help documents from each plugin and makes them accessible from vim. Commented things a bit so it's clear what's going on too. --- update | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/update b/update index da72164..ba61629 100755 --- a/update +++ b/update @@ -1,18 +1,27 @@ #!/usr/bin/env bash +# work from the base directory of the repository cd "${0%/*}" +# create the user vimrc file in the directory if it doesn't already exist if [ ! -e vim/vimrc.user ]; then [[ -w vim ]] && touch vim/vimrc.user; fi +# update the repository and submodules git pull origin git submodule update --init --recursive +# delete any submodule no longer in the repository [[ -f .gitmodules ]] && for each in vim/bundle/*; do if [ -d "$each" ]; then if [ -f "${each}/.git" ]; then FILE=$(echo $each | grep -o -e "[^\/]*$") - [[ `cat .gitmodules | grep "path = " | grep -o -e "[^\/]*$" | grep -c "${FILE}"` = 0 ]] && (rm -rf "${each}" && echo "Deleted: ${each}" || (echo -e "\033[01;31mWARNING\033[00m: '${each}' was removed upstream but couldn't be deleted here.\n\nPlease delete ${each} manually."; exit 1)) + [[ `cat .gitmodules | grep "path = " | grep -o -e "[^\/]*$" | grep -c "${FILE}"` = 0 ]] && (rm -rf "${each}" && echo "Deleted: ${each}" || (echo -e "\033[01;31mWARNING\033[00m: '${each}' was removed upstream but couldn't be deleted here.\n\nPlease delete ${each} manually."; exit 1)) fi fi done + +# update the help text for any new/changed pathogen plugin +[[ `type -P vim` ]] && vim -c "Helptags|qa!" &>/dev/null 2>&1 + +# exit cleanly exit 0