Browse Source

Added a boostrapping script to convert an existing system to use the dotfile repository.

master
Drew Short 9 years ago
parent
commit
c5a153f962
  1. 28
      bootstrap.sh

28
bootstrap.sh

@ -0,0 +1,28 @@
#!/usr/bin/env bash
#
# A script to convert the local system to use my dotfiles my local dotfiles over
# the provided ones already on the system. This script will backup any of the
# existing dot files, before linking to the ones in this repository.
#
# Helper Functions
# Make a backup of the existing file if it exists
# Then link to our supplied dotfile
link() {
if [ -f "$HOME/$1" ]; then
cp "$HOME/$1" "$HOME/$1.old"
echo "Backed up original $1 to $HOME/$1.old"
fi
ln -sf "$PWD/$2" "$HOME/$1"
}
set -x
set -e
# Configure .vimrc
link ".vimrc" "vimrc"
# Configure .gitconfig
link ".gitconfig" "gitconfig"
Loading…
Cancel
Save