on main help sign in
fix: respect disabled indeterminate progress bar setting on app start (#2054)
c3ae230Christian Rocha
internal/cmd/root.go+9−2
@@ -179,12 +179,19 @@ func supportsProgressBar() bool {
179}
179}
180
180
181func setupAppWithProgressBar(cmd *cobra.Command) (*app.App, error) {
181func setupAppWithProgressBar(cmd *cobra.Command) (*app.App, error) {
182+ app, err := setupApp(cmd)
183+ if err != nil {
184+ return nil, err
185+ }
186+
187+ // Check if progress bar is enabled in config (defaults to true if nil)
188+ progressEnabled := app.Config().Options.Progress == nil || *app.Config().Options.Progress
182− if supportsProgressBar() {
189+ if progressEnabled && supportsProgressBar() {
183 _, _ = fmt.Fprintf(os.Stderr, ansi.SetIndeterminateProgressBar)
190 _, _ = fmt.Fprintf(os.Stderr, ansi.SetIndeterminateProgressBar)
184 defer func() { _, _ = fmt.Fprintf(os.Stderr, ansi.ResetProgressBar) }()
191 defer func() { _, _ = fmt.Fprintf(os.Stderr, ansi.ResetProgressBar) }()
185 }
192 }
186
193
187− return setupApp(cmd)
194+ return app, nil
188}
195}
189
196
190// setupApp handles the common setup logic for both interactive and non-interactive modes.
197// setupApp handles the common setup logic for both interactive and non-interactive modes.