From d01ea8aaff39f2da97f178bf0def2f06b094e7c8 Mon Sep 17 00:00:00 2001 From: Riley Date: Mon, 21 Apr 2025 11:23:05 -0500 Subject: [PATCH] Add choice prompt for if user wants to update installer or not. (#239) This commit adds a choice prompt for if a user wishes to update their Equicord installer or not. This also serves as a bandaid fix for people on metered connections always updating the Equicord installer when they do not mean to. Co-authored-by: Riley --- misc/install.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) mode change 100644 => 100755 misc/install.sh diff --git a/misc/install.sh b/misc/install.sh old mode 100644 new mode 100755 index 08fe8bdd..d245733f --- a/misc/install.sh +++ b/misc/install.sh @@ -62,8 +62,16 @@ check_for_updates() { local_modified=$(stat -c "%y" "$INSTALLER_PATH" | cut -d' ' -f1-2) || error "Failed to get local modified date" if [ "$local_modified" != "$latest_modified" ]; then - echo -e "${YELLOW}Installer is outdated. Updating...${NC}" - download_installer + echo -e "${YELLOW}Installer is outdated. Do you wish to update? [y/n]${NC}" + read -p "" -n 1 -r retval + + # Create a new line before printing our next notice, otherwise it will be printed on the same line + # that the prompt was created on! + echo "" + case "$retval" in + y|Y ) download_installer;; + n|N ) echo -e "${YELLOW}Update cancelled. Running installer...${NC}" && return;; + esac else echo -e "${GREEN}Installer is up-to-date.${NC}" fi