Skip to content

Commit

Permalink
fix: --output-document flag for multisign (#363)
Browse files Browse the repository at this point in the history
* fix: output-document flag

* Revert "fix: output-document flag"

This reverts commit 991be5e.

* fix: cherry pick just the fix
  • Loading branch information
rootulp authored Jan 11, 2024
1 parent bc89c06 commit 590938d
Showing 1 changed file with 4 additions and 17 deletions.
21 changes: 4 additions & 17 deletions x/auth/client/cli/tx_multisign.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,27 +186,14 @@ func makeMultiSignCmd() func(cmd *cobra.Command, args []string) (err error) {
}
}

outputDoc, _ := cmd.Flags().GetString(flags.FlagOutputDocument)
if outputDoc == "" {
cmd.Printf("%s\n", json)
return
}

fp, err := os.OpenFile(outputDoc, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0o644)
closeFunc, err := setOutputFile(cmd)
if err != nil {
return err
}

defer func() {
err2 := fp.Close()
if err == nil {
err = err2
}
}()

err = clientCtx.PrintBytes(json)

return
defer closeFunc()
cmd.Printf("%s\n", json)
return nil
}
}

Expand Down

0 comments on commit 590938d

Please sign in to comment.