Documentation
¶
Overview ¶
Package wizard collects the dotty init answers: the profile, the repository paths, and the what-goes-on-this-machine-class selections. A profile that already has answers seeds every question's default with them, so a re-run walks the same interview to extend the profile; flags silence their question, and without a terminal the seeded answers are taken as-is. The wizard only asks — rendering, linking, and key setup act on the scaffold.Answers it returns.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Collect ¶
Collect resolves the wizard answers: the profile first (so a machine with existing profiles picks instead of typing), then the full interview. A previous run's persisted answers seed every question's default, so a re-run walks the same interview to extend the profile — pressing enter throughout keeps it as it is — while non-interactive re-runs take the stored answers as-is. Flags override in both cases, and --yes silences every question the stored profile already answers, so a --yes re-run asks only the profile pick plus whatever the stored document predates. Backing out of any prompt surfaces as tui.ErrAborted. It returns the answers, the resolved repository path, and whether an existing profile's answers seeded the run.
func ConfirmSummary ¶
ConfirmSummary recaps what init will do and asks once; false means the user backed out.
func ExistingProfiles ¶ added in v0.3.0
ExistingProfiles lists the profiles a run started with these flags would find — the machine's own plus the selected repository's. It is how `dotty profile new` tells a free name from one that already belongs to a machine class, which is a re-run of init rather than a new profile.
Types ¶
type Flags ¶
type Flags struct {
Repo string
ReposDir string
// ProfileName and Description name and describe the profile. Neither is
// a question the interview repeats on a re-run: the name is settled
// before it starts, and the description is metadata a stored profile
// keeps unless a flag replaces it.
ProfileName string
Description string
AddOns []string
Agents []string
DumpBrews bool
Marketplace bool
Harden bool
SecurityKeys bool
GitName string
GitEmail string
AllowedSerials []string
Worktrees string
MacOSDefaults []string
Wallpaper string
PIV bool
OnConflict string
// Yes skips the confirmation summary and, on a re-run, every question the
// stored profile already answers — only the profile pick and questions the
// stored document predates are asked.
Yes bool
SkipFont bool
SkipGit bool
SkipKeys bool
}
Flags holds the options for `dotty init` — and for `dotty profile new`, which is the same interview with the profile named up front. Every wizard question has a mirroring flag so the command also runs unattended; the trailing fields (OnConflict onward) steer the steps after the interview.