mirror of
https://github.com/RetroDECK/RetroDECK.git
synced 2025-02-16 19:35:39 +00:00
Add basic online version check
This commit is contained in:
parent
8f8d9c2bb6
commit
b577c3275b
|
@ -15,6 +15,7 @@ sdcard=/run/media/mmcblk0p1
|
|||
power_user_warning=true
|
||||
desktop_mode_warning=true
|
||||
network_features=false
|
||||
update_repo=RetroDECK
|
||||
multi_user_mode=false
|
||||
ask_default_user=true
|
||||
default_user=
|
||||
|
|
11
functions.sh
11
functions.sh
|
@ -632,6 +632,17 @@ check_network_connectivity() {
|
|||
fi
|
||||
}
|
||||
|
||||
check_for_version_update() {
|
||||
# This function will perform a basic online version check and alert the user if there is a new version available.
|
||||
|
||||
local current_version=$(sed -e 's/[\.a-z]//g' <<< $version)
|
||||
local online_version=$(curl --silent "https://api.github.com/repos/XargonWan/$update_repo/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/' | sed -e 's/[\.a-z]//g')
|
||||
|
||||
if [[ $current_version -le $online_version ]]; then
|
||||
echo "There is a new version online!"
|
||||
fi
|
||||
}
|
||||
|
||||
validate_input() {
|
||||
while IFS="^" read -r input action
|
||||
do
|
||||
|
|
Loading…
Reference in a new issue