diff --git a/lib/uninstall.bash b/lib/uninstall.bash index eb9ea60..7493c35 100644 --- a/lib/uninstall.bash +++ b/lib/uninstall.bash @@ -7,20 +7,20 @@ cd || exit source "$MIAOU_BASH_DIR"/lib/functions.bash -_confirm_destructive - -if [[ -f /etc/bash.bashrc.ORIGINAL ]]; then - rm /etc/bash.bashrc - mv /etc/bash.bashrc.ORIGINAL /etc/bash.bashrc -fi - -if [[ -f /etc/inputrc.ORIGINAL ]]; then - rm /etc/inputrc - mv /etc/inputrc.ORIGINAL /etc/inputrc +if _confirm_destructive; then + if [[ -f /etc/bash.bashrc.ORIGINAL ]]; then + rm /etc/bash.bashrc + mv /etc/bash.bashrc.ORIGINAL /etc/bash.bashrc + fi + + if [[ -f /etc/inputrc.ORIGINAL ]]; then + rm /etc/inputrc + mv /etc/inputrc.ORIGINAL /etc/inputrc + fi + + rm -f /etc/vimrc/vimrc.{azerty,core,local,miaou,rookie} + rm -rf /opt/miaou-bash + + unset MIAOU_BASH_DIR + echo 'MIAOU-BASH fully uninstalled, restored from original' fi - -rm -f /etc/vimrc/vimrc.{azerty,core,local,miaou,rookie} -rm -rf /opt/miaou-bash - -unset MIAOU_BASH_DIR -echo 'MIAOU-BASH fully uninstalled, restored from original'