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.

28 lines
646 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 "$HOME/$1" ]; then
  12. cp "$HOME/$1" "$HOME/$1.old"
  13. echo "Backed up original $1 to $HOME/$1.old"
  14. fi
  15. ln -sf "$PWD/$2" "$HOME/$1"
  16. }
  17. set -x
  18. set -e
  19. # Configure .vimrc
  20. link ".vimrc" "vimrc"
  21. # Configure .gitconfig
  22. link ".gitconfig" "gitconfig"