
echo
echo "Add Vim to System"
echo "--------------------------------------"
echo
echo "This script will copy Vim to the system."
echo

echo -n "Proceed (y/n)? (default: y): "
read proceed
echo

if [ "$proceed" == "n" ]
then
  exit 0
fi


if [ ! -d WORKING_* ]
then
  echo
  echo Working folder not found!
  exit 0
fi

orig_folder=`pwd`

vim_tar=$orig_folder/scripts/plugins/vim.tgz

if [ ! -f $vim_tar ]
then
  echo "$vim_tar is missing!"
fi

echo
cd WORKING_*

for dir in system/lib system/usr/share system/xbin
do
if [ ! -d $dir ]
then
  echo "$dir is missing!"
  cd ..
  exit 0
fi
done

tar -xzf $vim_tar

if [ "$?" == "0" ]
then
  echo
  echo "Finished"
fi

cd $orig_folder

