#!/bin/bash

# This pulls in the latest mreschke/vimrc but also ALTERS the vimrc for manup
# mReschke 2019-10-31

base=/var/www/manup/nwq/vimrc
vim=$base/source/vimrc-current/etc/vim

# Reset git
echo "Resetting git hard HEAD"
cd $vim
git reset
git checkout .
git reset --hard HEAD
git clean -fxd

# Pull new git
echo "Pulling new git"
cd $vim
git pull

# Modify vimrc for manup specifically
echo "Changing the vim-plug directory to /etc/vim/plugged for manup"
cd $vim
sed -i 's|~/\.vim/plugged|/etc/vim/plugged|g' ./vimrc 

echo 
echo "DONE!"
echo
echo "REMEMBER: Could be new vim-plug plugins.  On linstore open vim and run :PlugInstall"
echo "Then run ./package and you are done!"
