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
|
#!/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
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue