Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 14 additions & 7 deletions internal/sync/plan.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,16 +96,23 @@ func Execute(plan *SyncPlan, dryRun bool) (*SyncResult, error) {
executeSyncStep(plan.InstallTaps, "taps", func() error {
return brew.InstallTaps(plan.InstallTaps, dryRun)
}),
executeSyncStep(plan.InstallFormulae, "formulae", func() error {
return brew.Install(plan.InstallFormulae, dryRun)
}),
executeSyncStep(plan.InstallCasks, "casks", func() error {
return brew.InstallCask(plan.InstallCasks, dryRun)
}),
}
// Run formulae+casks through one shared StickyProgress bar — same flow
// the wizard path uses. Skipping this and calling brew.Install /
// brew.InstallCask separately would lose the byte-level progress bar.
if len(plan.InstallFormulae) > 0 || len(plan.InstallCasks) > 0 {
_, _, err := brew.InstallWithProgress(plan.InstallFormulae, plan.InstallCasks, dryRun)
step := stepResult{label: "brew", err: err}
if err == nil {
step.count = len(plan.InstallFormulae) + len(plan.InstallCasks)
}
installSteps = append(installSteps, step)
}
installSteps = append(installSteps,
executeSyncStep(plan.InstallNpm, "npm", func() error {
return npm.Install(plan.InstallNpm, dryRun)
}),
}
)
for _, s := range installSteps {
if s.err != nil {
errs = append(errs, fmt.Errorf("install %s: %w", s.label, s.err))
Expand Down
Loading