Skip to content

Commit

Permalink
cobra complies after all
Browse files Browse the repository at this point in the history
  • Loading branch information
orpheuslummis committed Sep 16, 2022
1 parent 868ce61 commit 05e78d3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
1 change: 1 addition & 0 deletions cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ func Execute() {
// Silence cobra's default output to control usage and error display.
rootCmd.SilenceUsage = true
rootCmd.SilenceErrors = true
rootCmd.SetOut(os.Stdout)
err := rootCmd.ExecuteContext(ctx)
if err != nil {
log.FeedbackError(ctx, fmt.Sprintf("%s", err))
Expand Down
15 changes: 4 additions & 11 deletions cli/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ package cli
import (
"context"
"fmt"
"os"

"github.com/sourcenetwork/defradb/config"
"github.com/spf13/cobra"
Expand Down Expand Up @@ -61,16 +60,10 @@ See https://docs.source.network/BSL.txt for more information.
return err
}

stdout, err := os.Stdout.Stat()
if err != nil {
return fmt.Errorf("failed to stat stdout: %w", err)
}
if !isFileInfoPipe(stdout) {
if defaultConfig {
log.FeedbackInfo(cmd.Context(), "Using default configuration")
} else {
log.FeedbackInfo(cmd.Context(), fmt.Sprintf("Configuration loaded from DefraDB directory %v", rootDir))
}
if defaultConfig {
log.FeedbackInfo(cmd.Context(), "Using default configuration")
} else {
log.FeedbackInfo(cmd.Context(), fmt.Sprintf("Configuration loaded from DefraDB directory %v", rootDir))
}
return nil
},
Expand Down

0 comments on commit 05e78d3

Please sign in to comment.