diff --git a/install/dotfiles.sh b/install/dotfiles.sh index 4cad1f4..19620dc 100644 --- a/install/dotfiles.sh +++ b/install/dotfiles.sh @@ -3,12 +3,16 @@ mkdir -p ~/.config # Link all dotfiles for entry in dotfiles/*; do + # Link all root files as .file in ~/ + # Any existing files will be renamed .bak if [ -f "$entry" ]; then - target=~/"$(basename "$entry")" + target=~/."$(basename "$entry")" [ -e "$target" ] && mv "$target" "$target.bak" ln -s "$(pwd)/$entry" "$target" fi + # Link all directories in ~/.config/ + # Any existing directories will be renamed .bak if [ -d "$entry" ]; then target=~/.config/"$(basename "$entry")" [ -e "$target" ] && mv "$target" "$target.bak"