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 <admin@jvnkbin.moe>
This commit is contained in:
Riley 2025-04-21 11:23:05 -05:00 committed by GitHub
parent 8c4af321bf
commit d01ea8aaff
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

12
misc/install.sh Normal file → Executable file
View file

@ -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