Skip to content

Commit

Permalink
fix: stdout
Browse files Browse the repository at this point in the history
  • Loading branch information
Bastien Rigaud committed Sep 26, 2024
1 parent dd7929d commit d258cff
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions tools/cosmovisor/cmd/cosmovisor/show_upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,19 @@ func NewShowUpgradeInfoCmd() *cobra.Command {
Use: "show-upgrade-info <path to executable>",
Short: "Show upgrade-info.json into stdout.",
SilenceUsage: true,
Args: cobra.ExactArgs(1),
RunE: showUpgradeInfoCmd,
}

return showUpgradeInfo
}

func showUpgradeInfoCmd(cmd *cobra.Command, path string) error {
data, err := os.ReadFile(path)
func showUpgradeInfoCmd(cmd *cobra.Command, args []string) error {
if len(args) != 1 {
return fmt.Errorf("expected exactly one argument")
}

data, err := os.ReadFile(args[0])
if err != nil {
return fmt.Errorf("failed to read upgrade-info.json: %w", err)
}
Expand Down

0 comments on commit d258cff

Please sign in to comment.