Skip to content

Commit c655bcf

Browse files
authored
Fixed Generate key to allow empty account id (#126)
1 parent ab790ce commit c655bcf

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

cmd/keys.go

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,18 +47,14 @@ func GenerateKeysCmd() *cobra.Command {
4747
Use: "generate-key",
4848
Short: "Command to generate signer key pair",
4949
PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
50-
if accountID == "" {
50+
if accountID == "" && outputPath == "" {
5151
return bindConfiguration(cmd)
5252
}
5353
return nil
5454
},
5555

5656
RunE: func(cmd *cobra.Command, args []string) error {
57-
if accountID != "" {
58-
if outputPath == "" {
59-
fmt.Println("Please provide output path using --output flag")
60-
os.Exit(1)
61-
}
57+
if outputPath != "" {
6258
key := newKey(accountID)
6359
dumpJson(outputPath, key)
6460
fmt.Printf("key generated: [%s]", outputPath)

0 commit comments

Comments
 (0)