keep stderr quiet when the diff exits with differences
This commit is contained in:
@@ -123,7 +123,10 @@ func main() {
|
||||
root.AddCommand(configCmd())
|
||||
|
||||
if err := root.Execute(); err != nil {
|
||||
fmt.Fprintln(os.Stderr, "error:", err)
|
||||
// errSilent only carries an exit code; the diff is already printed.
|
||||
if !errors.Is(err, errSilent) {
|
||||
fmt.Fprintln(os.Stderr, "error:", err)
|
||||
}
|
||||
var ee *exitError
|
||||
if errors.As(err, &ee) {
|
||||
os.Exit(ee.code)
|
||||
|
||||
Reference in New Issue
Block a user