Link all the dotfiles

This commit is contained in:
David Heinemeier Hansson 2024-05-25 19:28:50 -07:00
parent cd9184b67e
commit f3b60cfe9d

19
install/dotfiles.sh Normal file
View File

@ -0,0 +1,19 @@
# 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