vitorpy's Dotfiles

Remove the old symlinks scripts instead of xxx

-31
-31
makesymlinks.sh
··· 1 - #!/bin/bash 2 - ############################ 3 - # .make.sh 4 - # This script creates symlinks from the home directory to any desired dotfiles in ~/dotfiles 5 - ############################ 6 - 7 - ########## Variables 8 - 9 - dir=~/dotfiles # dotfiles directory 10 - olddir=~/dotfiles_old # old dotfiles backup directory 11 - files="bashrc vimrc vim zshrc oh-my-zsh" # list of files/folders to symlink in homedir 12 - 13 - ########## 14 - 15 - # create dotfiles_old in homedir 16 - echo "Creating $olddir for backup of any existing dotfiles in ~" 17 - mkdir -p $olddir 18 - echo "...done" 19 - 20 - # change to the dotfiles directory 21 - echo "Changing to the $dir directory" 22 - cd $dir 23 - echo "...done" 24 - 25 - # move any existing dotfiles in homedir to dotfiles_old directory, then create symlinks 26 - for file in $files; do 27 - echo "Moving any existing dotfiles from ~ to $olddir" 28 - mv ~/.$file ~/dotfiles_old/ 29 - echo "Creating symlink to $file in home directory." 30 - ln -s $dir/$file ~/.$file 31 - done