2023-11-10 16:12:15 -05:00
|
|
|
# ------------------------------------------------------
|
|
|
|
# Prepare dotfiles
|
|
|
|
# ------------------------------------------------------
|
2023-11-17 07:48:02 -05:00
|
|
|
echo -e "${GREEN}"
|
2023-12-21 15:57:44 -05:00
|
|
|
figlet "Preparation"
|
2023-11-17 07:48:02 -05:00
|
|
|
echo -e "${NONE}"
|
2024-02-19 12:14:24 -05:00
|
|
|
if [ -d ~/.config ]; then
|
|
|
|
echo ".config folder already exists."
|
|
|
|
else
|
|
|
|
mkdir ~/.config
|
|
|
|
echo ".config folder created."
|
|
|
|
fi
|
|
|
|
echo
|
2024-01-25 14:55:32 -05:00
|
|
|
echo ":: Preparing temporary folders for the installation."
|
2023-11-10 16:12:15 -05:00
|
|
|
if [ ! -d ~/dotfiles-versions ]; then
|
|
|
|
mkdir ~/dotfiles-versions
|
2024-01-25 14:55:32 -05:00
|
|
|
echo ":: ~/dotfiles-versions folder created."
|
2023-11-10 16:12:15 -05:00
|
|
|
fi
|
|
|
|
if [ ! -d ~/dotfiles-versions/$version ]; then
|
|
|
|
mkdir ~/dotfiles-versions/$version
|
2024-01-25 14:55:32 -05:00
|
|
|
echo ":: ~/dotfiles-versions/$version folder created."
|
2023-11-10 16:12:15 -05:00
|
|
|
else
|
2024-01-25 14:55:32 -05:00
|
|
|
echo ":: The folder ~/dotfiles-versions/$version already exists from previous installations."
|
2023-11-25 10:53:12 -05:00
|
|
|
rm -rf ~/dotfiles-versions/$version
|
2023-11-17 07:48:02 -05:00
|
|
|
mkdir ~/dotfiles-versions/$version
|
2024-01-25 14:55:32 -05:00
|
|
|
echo ":: Clean build prepared for the installation."
|
2023-11-10 16:12:15 -05:00
|
|
|
fi
|
2024-02-19 12:14:24 -05:00
|
|
|
rsync -a -I --exclude-from=.install/includes/excludes.txt . ~/dotfiles-versions/$version/
|
2023-11-25 10:53:12 -05:00
|
|
|
if [[ $(_isFolderEmpty ~/dotfiles-versions/$version/) == 0 ]] ;then
|
|
|
|
echo "AN ERROR HAS OCCURED. Preparation of ~/dotfiles-versions/$version/ failed"
|
|
|
|
echo "Please check that rsync is installad on your system."
|
2024-02-19 12:14:24 -05:00
|
|
|
echo "Execution of rsync -a -I --exclude-from=.install/includes/excludes.txt . ~/dotfiles-versions/$version/ is required."
|
2023-11-25 10:53:12 -05:00
|
|
|
exit
|
|
|
|
fi
|
2024-01-25 14:55:32 -05:00
|
|
|
echo ":: dotfiles $version successfully prepared in ~/dotfiles-versions/$version/"
|
2023-11-10 16:12:15 -05:00
|
|
|
echo ""
|