Skip to content

Commit bcc21b3

Browse files
committed
feat: show package list and confirm before custom config install
When installing from a remote config (openboot -u or curl install), show the full package list and ask for confirmation before installing. Skipped in --silent and --dry-run modes.
1 parent 0e89649 commit bcc21b3

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

internal/installer/installer.go

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,28 @@ func runCustomInstall(cfg *config.Config) error {
115115
ui.Info(fmt.Sprintf("Estimated install time: ~%d min for %d packages", minutes, totalPackages))
116116
fmt.Println()
117117

118+
if formulaeCount > 0 {
119+
ui.Muted(" CLI tools: " + strings.Join(cfg.RemoteConfig.Packages, ", "))
120+
}
121+
if caskCount > 0 {
122+
ui.Muted(" Apps: " + strings.Join(cfg.RemoteConfig.Casks, ", "))
123+
}
124+
if npmCount > 0 {
125+
ui.Muted(" npm: " + strings.Join(cfg.RemoteConfig.Npm, ", "))
126+
}
127+
fmt.Println()
128+
129+
if !cfg.Silent && !cfg.DryRun {
130+
proceed, err := ui.Confirm("Install these packages?", true)
131+
if err != nil {
132+
return err
133+
}
134+
if !proceed {
135+
return ErrUserCancelled
136+
}
137+
fmt.Println()
138+
}
139+
118140
if len(cfg.RemoteConfig.Taps) > 0 {
119141
if err := brew.InstallTaps(cfg.RemoteConfig.Taps, cfg.DryRun); err != nil {
120142
ui.Warn(fmt.Sprintf("Some taps failed: %v", err))

0 commit comments

Comments
 (0)