#!/bin/sh # if the dotfile already exist and it is NOT a symbolic link, # make a rename to save it and replace with an symbolic link to # $HOME/dotfiles/$FILE function create_link { if [ -e $HOME/$1 ] then if [ ! -h $HOME/$1 ] then mv $HOME/$1 $HOME/$1.orig ln -s $HOME/dotfiles/$1 $HOME/$1 fi fi } create_link .bash_aliases create_link .bash_profile create_link .bashrc create_link .bashrc_local create_link .tmux.conf if [ -d $HOME/.vim ] then if [ ! -h $HOME/.vim ] then mv $HOME/.vim $HOME/.vim.orig ln -s $HOME/dotfiles/.vim $HOME/.vim fi fi create_link .vimrc