20 lines
471 B
Bash
Executable File
20 lines
471 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
# list of files/folders to symlink in homedir
|
|
FILES="bin .aliases .exports .npmrc .vimrc .zshrc"
|
|
|
|
for FILE in $FILES; do
|
|
|
|
# remove old versions
|
|
if [ -f "$HOME/$FILE" ]; then
|
|
rm "$HOME"/"$FILE"
|
|
elif [ -d "$HOME/$FILE" ]; then
|
|
rm -r "${HOME:?}"/"$FILE"
|
|
fi
|
|
|
|
# symlink files
|
|
ln -s "$PWD"/"$FILE" "$HOME"/"$FILE"
|
|
echo "$(tput setaf 64)✓$(tput sgr0) Symlink created to $(tput setaf 37)$FILE$(tput sgr0)"
|
|
|
|
done
|