better deletion of old symlinks

This commit is contained in:
Matthias Kretschmann 2016-05-07 22:22:39 +02:00
parent 4964a5850a
commit 70d84d6ed1
Signed by: m
GPG Key ID: BD3C1F3EDD7831FC
1 changed files with 8 additions and 2 deletions

View File

@ -3,11 +3,17 @@
# list of files/folders to symlink in homedir
FILES=".bash_aliases .bash_prompt .bashrc .profile bin .vimrc"
# remove old version and symlink files
for FILE in $FILES; do
rm ~/$FILE
# remove old versions
if [ -d "~/$FILE" ] ; then
rm -r ~/$FILE
fi
# symlink files
ln -s $PWD/$FILE ~/$FILE
echo "$(tput setaf 64)$(tput sgr0) Symlink created to $(tput setaf 37)$FILE$(tput sgr0)"
done
# source what we just created