makedots.sh 935 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #!/bin/bash -e
  2. DIR=$(pwd)
  3. # Choose only the template
  4. if [ ! $1 ]
  5. then
  6. echo "Please specify [template suffix]. for a local zsh config."
  7. exit
  8. fi
  9. # Install Template
  10. if [ -f $HOME/.zshrc.local -o -h $HOME/.zshrc.local -o -d $HOME/.zshrc.local ]
  11. then
  12. rm -i $HOME/.zshrc.local
  13. fi
  14. ln -s $DIR/zshrc.local.$1 $HOME/.zshrc.local
  15. # Install all dotfiles
  16. if [ -f $HOME/.zshrc -o -h $HOME/.zshrc -o -d $HOME/.zshrc ]
  17. then
  18. rm -ri $HOME/.zshrc
  19. fi
  20. ln -s $DIR/zshrc $HOME/.zshrc
  21. for i in vimrc vim bashrc tmux.conf zshrc emacs.d dircolors
  22. do
  23. if [ -f $HOME/.$i -o -h $HOME/.$i -o -d $HOME/.$i ]
  24. then
  25. rm -ri $HOME/.$i
  26. fi
  27. ln -s $DIR/$i $HOME/.$i
  28. done
  29. # Nvim
  30. mkdir -p $HOME/.config/
  31. if [ -d $HOME/.config/nvim ]
  32. then
  33. rm -ri $HOME/.config/nvim
  34. fi
  35. ln -s $DIR/vim $HOME/.config/nvim
  36. # Antigen
  37. if [ -h $HOME/.antigen.zsh ]
  38. then
  39. rm -i $HOME/.antigen.zsh
  40. fi
  41. ln -s $DIR/antigen/antigen.zsh $HOME/.antigen.zsh