2024-05-25 21:28:50 -05:00
|
|
|
# Ensure .config exists
|
|
|
|
mkdir -p ~/.config
|
|
|
|
|
|
|
|
# Link all dotfiles
|
|
|
|
for entry in dotfiles/*; do
|
2024-05-25 21:46:14 -05:00
|
|
|
# Link all root files as .file in ~/
|
|
|
|
# Any existing files will be renamed .bak
|
2024-05-25 21:28:50 -05:00
|
|
|
if [ -f "$entry" ]; then
|
2024-05-25 21:46:14 -05:00
|
|
|
target=~/."$(basename "$entry")"
|
2024-05-25 21:28:50 -05:00
|
|
|
[ -e "$target" ] && mv "$target" "$target.bak"
|
|
|
|
ln -s "$(pwd)/$entry" "$target"
|
|
|
|
fi
|
|
|
|
|
2024-05-25 21:46:14 -05:00
|
|
|
# Link all directories in ~/.config/
|
|
|
|
# Any existing directories will be renamed .bak
|
2024-05-25 21:28:50 -05:00
|
|
|
if [ -d "$entry" ]; then
|
|
|
|
target=~/.config/"$(basename "$entry")"
|
|
|
|
[ -e "$target" ] && mv "$target" "$target.bak"
|
|
|
|
ln -s "$(pwd)/$entry" "$target"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
unset entry
|