Make update from menu check for new build

pull/6/head
Dominik Dzienia 8 months ago
parent 630893ae06
commit 8a4ada1599

@ -1113,7 +1113,7 @@ download_if_needed() {
local lastDownload=$(read_or_default "$UPDATES_DIR/downloaded" "")
local timestampNow=$(date +%s)
local updateCheck=$UPDATE_CHECK
if (((timestampNow - lastCheck) > updateCheck)) || [ "$lastDownload" == "" ] || [ "$lastDownload" == "error" ] || ((forceUpdateCheck == 1)); then
if (((timestampNow - lastCheck) > updateCheck)) || [ "$lastDownload" == "" ] || [ "$lastDownload" == "error" ] || ((forceUpdateCheck == 1)) || [ $# -eq 1 ]; then
echo "$timestampNow" >"$UPDATES_DIR/timestamp"
ohai "Checking if new version is available..."
local onlineUpdated="$(curl -fsSL "https://gitea.dzienia.pl/shared/mikrus-installer/raw/branch/$UPDATE_CHANNEL/updated")"
@ -1163,8 +1163,8 @@ update_background_check() {
}
update_if_needed() {
download_if_needed
download_if_needed "$@"
local lastDownload=$(read_or_default "$UPDATES_DIR/downloaded" "???")
local updateInstalled=$(read_or_default "$UPDATES_DIR/updated" "???")

@ -1097,7 +1097,7 @@ download_if_needed() {
local lastDownload=$(read_or_default "$UPDATES_DIR/downloaded" "")
local timestampNow=$(date +%s)
local updateCheck=$UPDATE_CHECK
if (((timestampNow - lastCheck) > updateCheck)) || [ "$lastDownload" == "" ] || [ "$lastDownload" == "error" ] || ((forceUpdateCheck == 1)); then
if (((timestampNow - lastCheck) > updateCheck)) || [ "$lastDownload" == "" ] || [ "$lastDownload" == "error" ] || ((forceUpdateCheck == 1)) || [ $# -eq 1 ]; then
echo "$timestampNow" >"$UPDATES_DIR/timestamp"
ohai "Checking if new version is available..."
local onlineUpdated="$(curl -fsSL "https://gitea.dzienia.pl/shared/mikrus-installer/raw/branch/$UPDATE_CHANNEL/updated")"
@ -1147,8 +1147,8 @@ update_background_check() {
}
update_if_needed() {
download_if_needed
download_if_needed "$@"
local lastDownload=$(read_or_default "$UPDATES_DIR/downloaded" "???")
local updateInstalled=$(read_or_default "$UPDATES_DIR/updated" "???")

@ -1 +1 @@
2024-10-25T17:04:40.997Z
2024-10-25T17:33:59.595Z
Loading…
Cancel
Save