list symlinks directly, simple is better here

This commit is contained in:
Sami Samhuri 2010-08-18 22:04:58 -07:00
parent 81034c833e
commit 0dd0f214db

19
init.sh
View file

@ -1,20 +1,17 @@
#!/bin/sh #!/bin/sh
cd
BASENAME="${0##*/}" BASENAME="${0##*/}"
if [ x"$1" != x ]; then if [ x"$1" != x ]; then
CONFIG_PATH="$1" CONFIG_PATH="$1"
else else
CONFIG_PATH="$HOME/config" CONFIG_PATH="${HOME}/config"
fi fi
for FILE in $CONFIG_PATH/*; do ln -s "${CONFIG_PATH}/emacs" ".emacs"
DOTFILE=".${FILE##*/}" ln -s "${CONFIG_PATH}/emacs.d" ".emacs.d"
if [ "$DOTFILE" = ".${BASENAME}" ]; then continue; fi ln -s "${CONFIG_PATH}/screenrc" ".screenrc"
if [ -e "$DOTFILE" ]; then ln -s "${CONFIG_PATH}/vimrc" ".vimrc"
mkdir original-dot-files >/dev/null 2>/dev/null ln -s "${CONFIG_PATH}/zshenv" ".zshenv"
echo "Existing file found at $DOTFILE, moving to ~/original-dot-files."
mv "$DOTFILE" original-dot-files/
fi
ln -s "$FILE" "$DOTFILE"
done