Skip to content

Commit 1cba595

Browse files
committed
fix(installer): show truthful header when steps fail — 'finished with errors' not 'Complete!'
1 parent c192eac commit 1cba595

1 file changed

Lines changed: 12 additions & 6 deletions

File tree

internal/installer/installer.go

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -124,21 +124,27 @@ func Apply(plan InstallPlan, r Reporter) error {
124124
}
125125
}
126126

127-
showCompletionFromPlan(plan, r)
127+
showCompletionFromPlan(plan, r, len(softErrs))
128128

129129
if len(softErrs) > 0 {
130-
fmt.Println()
131-
r.Warn(fmt.Sprintf("%d step(s) had errors — check the output above for details.", len(softErrs)))
132130
return errors.Join(softErrs...)
133131
}
134132
return nil
135133
}
136134

137-
func showCompletionFromPlan(plan InstallPlan, r Reporter) {
135+
func showCompletionFromPlan(plan InstallPlan, r Reporter, errCount int) {
138136
fmt.Println()
139-
r.Header("Installation Complete!")
137+
if errCount > 0 {
138+
r.Header("Installation finished with errors")
139+
} else {
140+
r.Header("Installation Complete!")
141+
}
140142
fmt.Println()
141-
r.Success("OpenBoot has successfully configured your Mac.")
143+
if errCount > 0 {
144+
r.Warn(fmt.Sprintf("%d step(s) had errors — check the output above for details.", errCount))
145+
} else {
146+
r.Success("OpenBoot has successfully configured your Mac.")
147+
}
142148
fmt.Println()
143149

144150
r.Info("What was installed:")

0 commit comments

Comments
 (0)