mirror of
https://github.com/Equicord/Equicord.git
synced 2025-05-10 17:35:37 +02:00
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:
parent
8c4af321bf
commit
d01ea8aaff
1 changed files with 10 additions and 2 deletions
12
misc/install.sh
Normal file → Executable file
12
misc/install.sh
Normal file → Executable 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"
|
local_modified=$(stat -c "%y" "$INSTALLER_PATH" | cut -d' ' -f1-2) || error "Failed to get local modified date"
|
||||||
|
|
||||||
if [ "$local_modified" != "$latest_modified" ]; then
|
if [ "$local_modified" != "$latest_modified" ]; then
|
||||||
echo -e "${YELLOW}Installer is outdated. Updating...${NC}"
|
echo -e "${YELLOW}Installer is outdated. Do you wish to update? [y/n]${NC}"
|
||||||
download_installer
|
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
|
else
|
||||||
echo -e "${GREEN}Installer is up-to-date.${NC}"
|
echo -e "${GREEN}Installer is up-to-date.${NC}"
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue