Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 27 lines (22 sloc) 585 Bytes
#!/bin/bash
# relink target-file source-file
relink() {
if [[ -h "$1" ]]; then
echo "Relinking $1"
# Symbolic link? Then recreate.
rm "$1"
ln -sn "$2" "$1"
elif [[ ! -e "$1" ]]; then
echo "Linking $1 to $2"
ln -sn "$2" "$1"
else
echo "$1 exists as a real file, skipping."
fi
}
DIR=$( cd "$( dirname "$0" )" && pwd )
relink ~/.bash_profile $DIR/bash_profile
relink ~/.bashrc $DIR/bashrc
relink ~/.gitconfig $DIR/git-config
relink ~/.gitignore $DIR/git-ignore-global
relink ~/.inputrc $DIR/inputrc
relink ~/bin $DIR/bin