You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
697 B

  1. #!/usr/bin/env bash
  2. #
  3. # A script to convert the local system to use my dotfiles my local dotfiles over
  4. # the provided ones already on the system. This script will backup any of the
  5. # existing dot files, before linking to the ones in this repository.
  6. #
  7. # Helper Functions
  8. # Make a backup of the existing file if it exists
  9. # Then link to our supplied dotfile
  10. link() {
  11. if [ -f "$1/$2" ]; then
  12. cp "$1/$2" "$1/$2.old"
  13. echo "Backed up original $2 to $1/$2.old"
  14. fi
  15. ln -sf "$PWD/$3" "$1/$2"
  16. }
  17. set -x
  18. set -e
  19. # Configure .vimrc
  20. link "$HOME" ".vimrc" "vimrc"
  21. # Configure .gitconfig
  22. link "$HOME" ".gitconfig" "gitconfig"
  23. # Configure .zshrc
  24. link "$HOME" ".zshrc" "zshrc"