dotfiles-server/bin/install-dotfiles.sh

20 lines
471 B
Bash
Raw Normal View History

#!/usr/bin/env bash
# list of files/folders to symlink in homedir
2019-10-27 01:56:26 +02:00
FILES="bin .aliases .exports .npmrc .vimrc .zshrc"
for FILE in $FILES; do
2016-05-07 22:22:39 +02:00
# remove old versions
if [ -f "$HOME/$FILE" ]; then
2017-07-29 20:27:19 +02:00
rm "$HOME"/"$FILE"
elif [ -d "$HOME/$FILE" ]; then
2017-07-29 20:27:19 +02:00
rm -r "${HOME:?}"/"$FILE"
2016-05-07 22:22:39 +02:00
fi
# symlink files
2017-07-29 20:27:19 +02:00
ln -s "$PWD"/"$FILE" "$HOME"/"$FILE"
echo "$(tput setaf 64)$(tput sgr0) Symlink created to $(tput setaf 37)$FILE$(tput sgr0)"
2016-05-07 22:22:39 +02:00
done