list symlinks directly, simple is better here
This commit is contained in:
parent
81034c833e
commit
0dd0f214db
1 changed files with 8 additions and 11 deletions
19
init.sh
19
init.sh
|
|
@ -1,20 +1,17 @@
|
|||
#!/bin/sh
|
||||
|
||||
cd
|
||||
|
||||
BASENAME="${0##*/}"
|
||||
|
||||
if [ x"$1" != x ]; then
|
||||
CONFIG_PATH="$1"
|
||||
else
|
||||
CONFIG_PATH="$HOME/config"
|
||||
CONFIG_PATH="${HOME}/config"
|
||||
fi
|
||||
|
||||
for FILE in $CONFIG_PATH/*; do
|
||||
DOTFILE=".${FILE##*/}"
|
||||
if [ "$DOTFILE" = ".${BASENAME}" ]; then continue; fi
|
||||
if [ -e "$DOTFILE" ]; then
|
||||
mkdir original-dot-files >/dev/null 2>/dev/null
|
||||
echo "Existing file found at $DOTFILE, moving to ~/original-dot-files."
|
||||
mv "$DOTFILE" original-dot-files/
|
||||
fi
|
||||
ln -s "$FILE" "$DOTFILE"
|
||||
done
|
||||
ln -s "${CONFIG_PATH}/emacs" ".emacs"
|
||||
ln -s "${CONFIG_PATH}/emacs.d" ".emacs.d"
|
||||
ln -s "${CONFIG_PATH}/screenrc" ".screenrc"
|
||||
ln -s "${CONFIG_PATH}/vimrc" ".vimrc"
|
||||
ln -s "${CONFIG_PATH}/zshenv" ".zshenv"
|
||||
|
|
|
|||
Loading…
Reference in a new issue