This commit is contained in:
Stephan Raabe 2023-12-22 09:17:34 +01:00
parent 978f70b897
commit 3c5d42e45b

View File

@ -1,25 +1,38 @@
# ------------------------------------------------------ # ------------------------------------------------------
# Install .bashrc # Install .bashrc
# ------------------------------------------------------ # ------------------------------------------------------
echo -e "${GREEN}" echo -e "${GREEN}"
figlet ".bashrc" figlet ".bashrc"
echo -e "${NONE}" echo -e "${NONE}"
if [ ! -L ~/.bashrc ] && [ -f ~/.bashrc ]; then if [ ! -L ~/.bashrc ] && [ -f ~/.bashrc ]; then
echo "PLEASE NOTE AGAIN: The script has detected an existing .bashrc file." echo "PLEASE NOTE: The script has detected an existing .bashrc file."
fi fi
if [ -f ~/dotfiles-versions/backups/$datets/.bashrc-old ]; then if [ -f ~/dotfiles-versions/backups/$datets/.bashrc-old ]; then
echo "Backup is already available here ~/dotfiles-versions/backups/$datets/.bashrc-old" echo "Backup is already available here ~/dotfiles-versions/backups/$datets/.bashrc-old"
fi fi
if [ ! -L ~/.bashrc ] && [ -f ~/.bashrc ]; then if [ ! -L ~/.bashrc ] && [ -f ~/.bashrc ]; then
bash_confirm="Do you want to replace your existing .bashrc file with the dotfiles .bashrc file?" bash_confirm="Do you want to replace your existing .bashrc file with the dotfiles .bashrc file?"
if gum confirm "$bash_confirm" ;then
rm ~/.bashrc
_installSymLink .bashrc ~/.bashrc ~/dotfiles/.bashrc ~/.bashrc
elif [ $? -eq 130 ]; then
exit 130
else
echo "Installation of the .bashrc file skipped."
fi
else else
bash_confirm="Do you want to install the dotfiles .bashrc file now?" bash_confirm="Do you want to install the dotfiles .bashrc file now?"
fi if gum confirm "$bash_confirm" ;then
if gum confirm "$bash_confirm" ;then if [ -L ~/.bashrc ] || [ -f ~/.bashrc ]; then
_installSymLink .bashrc ~/.bashrc ~/dotfiles/.bashrc ~/.bashrc rm ~/.bashrc
elif [ $? -eq 130 ]; then echo "Existing .bashrc removed."
exit 130 fi
else _installSymLink .bashrc ~/.bashrc ~/dotfiles/.bashrc ~/.bashrc
echo "Installation of the .bashrc file skipped." elif [ $? -eq 130 ]; then
exit 130
else
echo "Installation of the .bashrc file skipped."
fi
fi fi
echo "" echo ""