From 0cfdaf0d022ac0932390eebe3bd27dea77ae8c1b Mon Sep 17 00:00:00 2001 From: Drew Short Date: Thu, 10 Sep 2015 14:45:05 -0500 Subject: [PATCH] Fixed a dup bug in the boostrap script --- bootstrap.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/bootstrap.sh b/bootstrap.sh index 914b5a2..2a5a380 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -21,11 +21,16 @@ link() { link_dir() { # Only make a backup if an existing directory is there and is not a link - if [ -d "$1/$2" ] && [ ! -L "$1/$2" ]; then + if [ -d "$1/$2" ] && [ ! -L "$1/$2" ]; then mv "$1/$2" "$1/$2.old" echo "Backed up original $2 to $1/$2.old" fi - ln -sf "$3" "$1/$2" + + # Don't overwrite links + if [ ! -L "$1/$2" ]; then + echo "ln -sf $3 $1/$2" + ln -sf "$3" "$1/$2" + fi } set -x @@ -45,9 +50,11 @@ fi VIM_BUNDLE=$HOME/.vim/bundle mkdir -p $VIM_BUNDLE plugins=($(ls -d $PWD/.vim/bundle/* | tr -s ' ')) +echo "${plugins[@]}" for plugin in ${plugins[@]}; do parts=($(echo "$plugin" | tr '/' ' ')) plugin_name=${parts[-1]} + echo "$VIM_BUNDLE $plugin_name $plugin" link_dir $VIM_BUNDLE $plugin_name $plugin done @@ -64,6 +71,7 @@ if [ ! -f "$HOME/.update_dotfiles.sh" ]; then echo "cd $PWD" >> $HOME/.update_dotfiles.sh echo "git checkout master" >> $HOME/.update_dotfiles.sh echo "git pull" >> $HOME/.update_dotfiles.sh + echo "git submodule init" >> $HOME/.update_dotfiles.sh echo "git submodule update" >> $HOME/.update_dotfiles.sh chmod +x $HOME/.update_dotfiles.sh fi