fix: unattended install on a never-chosen box seeds the defaults

A fresh VM running `dotup install --unattended` got an empty plan and a
silent 'done'. -f $SEL cannot detect this (load-time setup creates the
file); choice is $PICKED or a non-empty selection, and only a box with
neither gets the defaults. A cron re-run of a saved selection and an
accepted chose-none both keep their meaning.
This commit is contained in:
bcherb2
2026-08-22 22:42:39 -04:00
parent 607745ecfd
commit e52d1384ca
2 changed files with 21 additions and 0 deletions
+8
View File
@@ -930,6 +930,14 @@ install_bespoke() {
}
cmd_install() {
# A cron job re-running `--unattended install` gets its SAVED selection --
# that contract stands. But on a box where nothing was ever chosen,
# "install what was saved" meant an empty plan and a silent "done" that
# installed nothing (found live 2026-08-23, phase 5 VM). `-f "$SEL"`
# cannot carry this test: load-time setup creates the file empty. Choice
# is what $PICKED marks (an accepted picker) or a non-empty selection (a
# preset); only a box with neither gets the defaults.
[ "$UNATTENDED" -ne 1 ] || [ -f "$PICKED" ] || [ -s "$SEL" ] || cmd_preset defaults
: > "$FAILED"
tbl=$STATE/.plan.$$
plan_table > "$tbl"