sunhat/install/dotfiles.sh

20 lines
413 B
Bash
Raw Normal View History

2024-05-25 21:28:50 -05:00
# Ensure .config exists
mkdir -p ~/.config
# Link all dotfiles
for entry in dotfiles/*; do
if [ -f "$entry" ]; then
target=~/"$(basename "$entry")"
[ -e "$target" ] && mv "$target" "$target.bak"
ln -s "$(pwd)/$entry" "$target"
fi
if [ -d "$entry" ]; then
target=~/.config/"$(basename "$entry")"
[ -e "$target" ] && mv "$target" "$target.bak"
ln -s "$(pwd)/$entry" "$target"
fi
done
unset entry