-
Notifications
You must be signed in to change notification settings - Fork 249
[code-cleanup] Rename devbox.Writer to Stderr #1507
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 4 commits
87073cd
64cbb86
5893444
97bcfd2
55ee060
32bb47e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In this case either works, but stdErr is logically correct. 👍 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,6 +37,9 @@ func RootCmd() *cobra.Command { | |
command := &cobra.Command{ | ||
Use: "devbox", | ||
Short: "Instant, easy, predictable development environments", | ||
// Warning, PersistentPreRunE is not called if a subcommand also declares | ||
// it. TODO: Figure out a better way to implement this so that subcommands | ||
// can't accidentally override it. | ||
PersistentPreRun: func(cmd *cobra.Command, args []string) { | ||
if flags.quiet { | ||
cmd.SetErr(io.Discard) | ||
|
@@ -49,6 +52,8 @@ func RootCmd() *cobra.Command { | |
SilenceErrors: true, | ||
SilenceUsage: true, | ||
} | ||
command.SetOut(os.Stdout) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. isn't this a no-op? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. maybe I am misunderstanding. I thought the idea behind If we're overriding here what the tests may set, then it won't work as desired. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So I'll fix this by removing |
||
|
||
// Stable commands | ||
command.AddCommand(addCmd()) | ||
if featureflag.Auth.Enabled() { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these config PackageNames or installable PackageNames?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just what is in config. This is a no-op (PrintGlobaList used to call PackageNames).
We can chat about whether this is correct or not (I think it's fine), but would rather not change it in this PR.