Skip to content
This repository was archived by the owner on May 22, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 12 additions & 14 deletions cmd/signing.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ import (
"sync"
"time"

"github.com/ipfs/go-log"

"github.com/keep-network/keep-common/pkg/logging"
"github.com/keep-network/keep-core/pkg/net"
"github.com/keep-network/keep-core/pkg/net/key"
"github.com/keep-network/keep-core/pkg/net/local"
Expand All @@ -33,7 +32,8 @@ func init() {
Name: "signing",
Usage: "Provides several tools useful for out-of-band signing",
Before: func(c *cli.Context) error {
_ = log.SetLogLevel("*", "fatal") // disable the regular logger
// disable the regular logger
_ = logging.Configure("keep*=fatal")
return nil
},
Subcommands: []cli.Command{
Expand Down Expand Up @@ -110,17 +110,7 @@ func DecryptKeyShare(c *cli.Context) error {
)
}

_, err = os.Stdout.Write(signerBytes)
if err != nil {
return fmt.Errorf(
"could not write signer bytes to stdout: [%v]",
err,
)
}

outputFilePath := c.String("output-file")

if len(outputFilePath) > 0 {
if outputFilePath := c.String("output-file"); len(outputFilePath) > 0 {
if _, err := os.Stat(outputFilePath); !os.IsNotExist(err) {
return fmt.Errorf(
"could not write shares to file; file [%s] already exists",
Expand All @@ -136,6 +126,14 @@ func DecryptKeyShare(c *cli.Context) error {
err,
)
}
} else {
_, err = os.Stdout.Write(signerBytes)
if err != nil {
return fmt.Errorf(
"could not write signer bytes to stdout: [%v]",
err,
)
}
}

return nil
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,6 @@ func main() {

err = app.Run(os.Args)
if err != nil {
logger.Fatal(err)
fmt.Print(err)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

☀️

No rush, but we should make this change to keep-core as well.

}
}