Advertisement
Guest User

sample install.sh

a guest
Jul 24th, 2013
248
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  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. vundledir=~/.vim/bundle/vundle
  12. files=".bashrc .vimrc .vim .tmux.conf .tmux-powerlinerc .xmonad .xmobarrc .oh-my-zsh .zshrc" # list of files/folders to symlink in homedir
  13.  
  14. ##########
  15.  
  16. # create dotfiles_old in homedir
  17. echo "Creating $olddir for backup of any existing dotfiles in ~"
  18. mkdir -p $olddir
  19. echo "...done"
  20.  
  21. # change to the dotfiles directory
  22. echo "Changing to the $dir directory"
  23. cd $dir
  24. echo "...done"
  25.  
  26. # move any existing dotfiles in homedir to dotfiles_old directory, then create symlinks
  27. for file in $files; do
  28. echo "Moving any existing dotfiles from ~ to $olddir"
  29. mv ~/$file ~/dotfiles_old/
  30. echo "Creating symlink to $file in home directory."
  31. ln -s $dir/$file ~/$file
  32. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement