|
|
@ -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 |