From 7e1a8f3b20bab9a9e5290faf9068d9169c5eb589 Mon Sep 17 00:00:00 2001 From: Katy248 Date: Mon, 28 Oct 2024 16:25:09 +0300 Subject: [PATCH] Added named arg --- install.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/install.sh b/install.sh index 7bcdf7e..8496944 100755 --- a/install.sh +++ b/install.sh @@ -151,20 +151,23 @@ install_deps() { # ################################################################### # +# $1 - path is_path_exists() { - if ! [ -d "$1" ]; then + local path=$1 + + if ! [ -d "${path}" ]; then return fi # BUG # echo -e "$WARNING The specified path '$1' already exists." - echo -e "$WARNING The specified path '${YELLOW}${1}${RESET}' already exists." + echo -e "$WARNING The specified path '${YELLOW}${path}${RESET}' already exists." 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 + if ! rm -rfv "${path:?}" 2>>./install_log.log; then print_err "Something went wrong." fi echo -e "$LOG Deleted old installation."