config/init.sh
2012-03-24 09:51:06 -07:00

27 lines
575 B
Bash
Executable file

#!/bin/bash
BASENAME="${0##*/}"
if [ x"$1" != x ]; then
CONFIG_PATH="$1"
elif [ -d "${HOME}/Dropbox/Personal/config" ]; then
CONFIG_PATH="${HOME}/Dropbox/Personal/config"
elif [ -d "${HOME}/config" ]; then
CONFIG_PATH="${HOME}/config"
else
echo "Error: no config dir found"
exit 1
fi
link_config() {
file="$1"
if [ ! -e "${HOME}/.$file" ]; then
ln -s "${CONFIG_PATH}/$file" "${HOME}/.$file"
fi
}
CONFIG_FILES="ackrc emacs emacs.d gitconfig screenrc vimrc zshenv gdbinit"
for file in $CONFIG_FILES; do
link_config "$file"
done