fix: BIOS dry run also walks through the restart choices

A dry run counts as staged, so [m]/[r] and the restart question on q show up; restarting only prints in dry-run mode.
This commit is contained in:
theupriser committed 2026-09-24 10:48:39 +02:00
1 parent 2e6d20a3f0
commit 0cb9f8b9ca
3 files changed
+14 -4

No files matched your search

+6 -2
View File
@@ -46,6 +46,10 @@ restart_now() {
warn "The BIOS update is written during this restart. Keep the power on and don't"
warn "touch the machine until it has fully started again, even if the screen stays black."
fi
if [[ -n "${BIOS_DRY_RUN:-}" ]]; then
ok "Dry run: would restart now (sudo reboot); not restarting."
exit 0
fi
info "Restarting..."
sudo reboot
exit 0
@@ -131,13 +135,13 @@ if [[ -n "${BIOS_NEEDS_RESTART:-}" ]]; then
warn "The BIOS update is written during the next restart. Keep the power on and"
warn "don't touch the machine until it has fully started again, even if the screen stays black."
if ask_yn "Restart now to install the BIOS update?" n; then
sudo reboot
restart_now
else
info "The BIOS update installs at your next restart."
fi
elif [[ "$RESTART_FOR_LOGIN" == true ]]; then
if ask_yn "Restart now so the changes take effect?" n; then
sudo reboot
restart_now
else
info "Restart whenever you're ready."
fi