sunhat/install/dotfiles.sh

23 lines
558 B
Bash
Raw Normal View History

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