add gum confirm and profile selector

This commit is contained in:
Stephan Raabe
2023-11-21 21:19:51 +01:00
parent fe9c69d24d
commit 30c453df3f
14 changed files with 114 additions and 160 deletions

44
.install/bashrc.sh Normal file → Executable file
View File

@@ -8,32 +8,24 @@ cat <<"EOF"
| '_ \ / _` / __| '_ \| '__/ __|
_| |_) | (_| \__ \ | | | | | (__
(_)_.__/ \__,_|___/_| |_|_| \___|
EOF
echo -e "${NONE}"
while true; do
if [ ! -L ~/.bashrc ] && [ -f ~/.bashrc ]; then
echo "PLEASE NOTE AGAIN: 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
echo ""
echo "Do you want to replace your existing .bashrc file with the dotfiles .bashrc file?"
else
echo ""
echo "Do you want to install the dotfiles .bashrc file now?"
fi
read -p "Please confirm (Yy/Nn): " yn
case $yn in
[Yy]* )
_installSymLink .bashrc ~/.bashrc ~/dotfiles/.bashrc ~/.bashrc
break;;
[Nn]* )
echo "Installation of the .bashrc file skipped."
break;;
* ) echo "Please answer yes or no.";;
esac
done
if [ ! -L ~/.bashrc ] && [ -f ~/.bashrc ]; then
echo "PLEASE NOTE AGAIN: 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?"
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."
fi
echo ""