Source

shlomif-computer-settings / shlomif-settings / hg / setup

#!/bin/bash

bn="hgrc"
conf_dir="$(cd "$(dirname "$0")" && pwd)"
dest="$HOME"

if ! test -d "$dest" ; then
    mkdir -p "$dest"
fi

dfull="$dest/.$bn"
if ! test -e "$dfull" ; then
    ln -sf "$conf_dir/$bn" "$dfull"
fi