diff --git a/init.sh b/init.sh index 87758db..bff898f 100755 --- a/init.sh +++ b/init.sh @@ -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