From 3c5d42e45b68efd005617b5eb6b29d5452dd6064 Mon Sep 17 00:00:00 2001 From: Stephan Raabe Date: Fri, 22 Dec 2023 09:17:34 +0100 Subject: [PATCH] Updates --- .install/bashrc.sh | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/.install/bashrc.sh b/.install/bashrc.sh index b60f6b2..65db75b 100755 --- a/.install/bashrc.sh +++ b/.install/bashrc.sh @@ -1,25 +1,38 @@ # ------------------------------------------------------ # Install .bashrc # ------------------------------------------------------ + echo -e "${GREEN}" figlet ".bashrc" echo -e "${NONE}" 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 if [ -f ~/dotfiles-versions/backups/$datets/.bashrc-old ]; then echo "Backup is already available here ~/dotfiles-versions/backups/$datets/.bashrc-old" fi if [ ! -L ~/.bashrc ] && [ -f ~/.bashrc ]; then 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 bash_confirm="Do you want to install the dotfiles .bashrc file now?" -fi -if gum confirm "$bash_confirm" ;then - _installSymLink .bashrc ~/.bashrc ~/dotfiles/.bashrc ~/.bashrc -elif [ $? -eq 130 ]; then - exit 130 -else - echo "Installation of the .bashrc file skipped." + if gum confirm "$bash_confirm" ;then + if [ -L ~/.bashrc ] || [ -f ~/.bashrc ]; then + rm ~/.bashrc + echo "Existing .bashrc removed." + fi + _installSymLink .bashrc ~/.bashrc ~/dotfiles/.bashrc ~/.bashrc + elif [ $? -eq 130 ]; then + exit 130 + else + echo "Installation of the .bashrc file skipped." + fi fi echo ""