kevinisageek/dotfiles — Issue #1: Make setup more robust
Author: pigmonkey
Created: 2012-02-24 17:46:17+00:00
State: open

Right now it's dependent on the repo being checked out at `$HOME/documents/projects/dotfiles`. You could do [something like this](http://stackoverflow.com/questions/59895/can-a-bash-script-tell-what-directory-its-stored-in/246128#246128) to get the current directory of the script. That would allow the script to execute regardless of where the repository is checked out to. It's bash only, so you'd want to change the script from a shell script to a bash script.

Another problem that you'll probably run into is existing files. Most machines will likely already have a `~/.bashrc` file. `ln` will not overwrite existing files, so your `bashrc` file will be skipped. You probably want some sort of conditional to check if the file already exists. I would just delete the existing file.

if [ -f $HOME/.bashrc ]; then
rm $HOME/.bashrc
ln -s $DOTFILES/bashrc $HOME/.bashrc
fi

If you wanted to get fancy you could put some sort of prompt in there to ask the user if they want to delete the existing file or skip it.