Skip to content

Commit

Permalink
chore: More minor output stream consolidation (#122)
Browse files Browse the repository at this point in the history
Follow-up for #105

* Use the Cobra standard error writer directly for the informational
output of the `init` command
* Use the global error writer consistently for the progress bar: both
the bar itself and the terminating newline should use the same writer
  • Loading branch information
spdawson committed Nov 15, 2022
1 parent a605c80 commit 21f31c0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions pkg/commands/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"fmt"

"github.com/bearer/curio/pkg/commands/process/settings"
"github.com/bearer/curio/pkg/util/output"
"github.com/spf13/cobra"
"github.com/spf13/viper"
"golang.org/x/xerrors"
Expand Down Expand Up @@ -35,7 +34,7 @@ func NewInitCommand() *cobra.Command {
return err
}

output.StdErrLogger().Msgf("created: curio.yml (default configuration file)")
cmd.PrintErrln("created: curio.yml (default configuration file)")
return nil
},
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/util/output/progress_bar.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ func GetProgressBar(filesLength int, config settings.Config) *progressbar.Progre
progressbar.OptionEnableColorCodes(false),
progressbar.OptionShowElapsedTimeOnFinish(),
progressbar.OptionOnCompletion(func() {
StdErrLogger().Msgf("\n")
errorWriter.Write([]byte("\n")) //nolint:all,errcheck
}),
progressbar.OptionShowIts(),
progressbar.OptionSetItsString("files"),
Expand Down

0 comments on commit 21f31c0

Please sign in to comment.