# HG changeset patch # User IBBoard # Date 1374951446 -3600 # Node ID a5fc9c16087ccb339d905a9a2f9a11fc19d358c8 # Parent 9114ad0f9d1d45f3df4e78c888feecc7126b780f Add setup script to symlink files diff -r 9114ad0f9d1d -r a5fc9c16087c setup.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/setup.sh Sat Jul 27 19:57:26 2013 +0100 @@ -0,0 +1,15 @@ +#! /bin/bash + +SCRIPTPATH=`dirname $(readlink -f $0)` +create_symlink() { + if [ ! -e $2 ]; then + ln -s $SCRIPTPATH/$1 $2 + elif [ "$(readlink $2)" != "$SCRIPTPATH/$1" ]; then + echo "Unable to link $1 config - $2 already existed" >&2 + fi + #Else it already existed but was correct +} + +create_symlink tmux.conf ~/.tmux.conf +create_symlink hgrc ~/.hgrc +create_symlink bashrc ~/.bashrc \ No newline at end of file