DRY up init.sh and add .gitconfig

This commit is contained in:
Sami Samhuri 2011-03-04 19:16:49 -08:00
parent 71fcb2a54d
commit 8a043d414b

16
init.sh
View file

@ -8,9 +8,13 @@ else
CONFIG_PATH="${HOME}/config"
fi
[ -e ".ackrc" ] || ln -s "${CONFIG_PATH}/ackrc" ".ackrc"
[ -e ".emacs" ] || ln -s "${CONFIG_PATH}/emacs" ".emacs"
[ -e ".emacs.d" ] || ln -s "${CONFIG_PATH}/emacs.d" ".emacs.d"
[ -e ".screenrc" ] || ln -s "${CONFIG_PATH}/screenrc" ".screenrc"
[ -e ".vimrc" ] || ln -s "${CONFIG_PATH}/vimrc" ".vimrc"
[ -e ".zshenv" ] || ln -s "${CONFIG_PATH}/zshenv" ".zshenv"
link_config() {
file="$1"
[ -e ".$file" ] || ln -s "${CONFIG_PATH}/$file" ".$file"
}
CONFIG_FILES="ackrc emacs emacs.d gitconfig screenrc vimrc zshenv"
for file in $CONFIG_FILES; do
link_config "$file"
done