Refactored is_path_exists function

This commit is contained in:
Katy248 2024-10-28 16:23:15 +03:00
parent e6282cbb61
commit c1f873a4d1

View File

@ -152,23 +152,22 @@ install_deps() {
#
is_path_exists() {
if [ -d "$1" ]; then
if ! [ -d "$1" ]; then
return
fi
# BUG
# echo -e "$WARNING The specified path '$1' already exists."
echo -e "$WARNING The specified path '${YELLOW}${1}${RESET}' already exists."
if ask_user "Do you want to ${RED}delete${RESET} previous installation?"; then
if rm -rfv "${1:?}" 2>>./install_log.log; then
echo -e "$LOG Deleted old installation."
else
echo -e "$ERROR Something went wrong."
exit 1
fi
else
if ! ask_user "Do you want to ${RED}delete${RESET} previous installation?"; then
echo -e "$LOG Exiting."
exit 1
fi
if ! rm -rfv "${1:?}" 2>>./install_log.log; then
print_err "Something went wrong."
fi
echo -e "$LOG Deleted old installation."
}
setup_wine() {