Skip to content

Commit 071ca60

Browse files
authored
dietpi-dashboard: enable stable installs after v0.7.0 release (#8015)
1 parent 8e6d474 commit 071ca60

1 file changed

Lines changed: 19 additions & 15 deletions

File tree

dietpi/dietpi-software

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3373,18 +3373,24 @@ _EOF_"
33733373

33743374
if To_Install 200 # DietPi-Dashboard
33753375
then
3376-
# Stable release or nightly?
3377-
local version='Nightly' # Enforce nightly until 0.7.0 is released
3378-
#local version=$(sed -n '/^[[:blank:]]*SOFTWARE_DIETPI_DASHBOARD_VERSION=/{s/^[^=]*=//p;q}' /boot/dietpi.txt)
3379-
#[[ $version == 'Nightly' ]] || version='Stable'
3380-
3381-
#G_WHIP_MENU_ARRAY=(
3382-
# 'Stable' ': Use a release version of DietPi-Dashboard.'
3383-
# 'Nightly' ': Use an unstable version of DietPi-Dashboard.'
3384-
#)
3385-
#G_WHIP_DEFAULT_ITEM=$version
3386-
#G_WHIP_BUTTON_CANCEL_TEXT=$version
3387-
#G_WHIP_MENU 'Please choose which version of DietPi-Dashboard should be installed.' && version=$G_WHIP_RETURNED_VALUE
3376+
# Grab latest release
3377+
local release=$(curl -sSfL 'https://api.github.com/repos/nonnorm/dietpi-dashboard/releases/latest' | grep -Po '"tag_name": *"\K[^"]+')
3378+
3379+
# Stable release or nightly choice, once v0.7.0 has been released
3380+
local version='Nightly'
3381+
if dpkg --compare-versions "${release#v}" ge 0.7.0
3382+
then
3383+
version=$(sed -n '/^[[:blank:]]*SOFTWARE_DIETPI_DASHBOARD_VERSION=/{s/^[^=]*=//p;q}' /boot/dietpi.txt)
3384+
[[ $version == 'Nightly' ]] || version='Stable'
3385+
3386+
G_WHIP_MENU_ARRAY=(
3387+
'Stable' ': Use a release version of DietPi-Dashboard.'
3388+
'Nightly' ': Use an unstable version of DietPi-Dashboard.'
3389+
)
3390+
G_WHIP_DEFAULT_ITEM=$version
3391+
G_WHIP_BUTTON_CANCEL_TEXT=$version
3392+
G_WHIP_MENU 'Please choose which version of DietPi-Dashboard should be installed.' && version=$G_WHIP_RETURNED_VALUE
3393+
fi
33883394

33893395
# Determine which components to install
33903396
local components=('backend')
@@ -3409,11 +3415,9 @@ _EOF_"
34093415
Download_Install "https://nightly.link/nonnorm/DietPi-Dashboard/workflows/push-build/main/dietpi-dashboard-$G_HW_ARCH_NAME-$component.zip" /opt/dietpi-dashboard
34103416
done
34113417
else
3412-
# NB: Will not work until 0.7.0 is released
3413-
local manifest=$(curl -sSfL 'https://api.github.com/repos/nonnorm/dietpi-dashboard/releases/latest')
34143418
for component in "${components[@]}"
34153419
do
3416-
Download_Install "$(echo "$manifest" | grep -Po "\"browser_download_url\": *\"\K[^\"]*dietpi-dashboard-$G_HW_ARCH_NAME-$component")" /opt/dietpi-dashboard
3420+
Download_Install "https://github.com/nonnorm/DietPi-Dashboard/releases/download/$release/dietpi-dashboard-$G_HW_ARCH_NAME-$component" /opt/dietpi-dashboard
34173421
done
34183422
fi
34193423

0 commit comments

Comments
 (0)