Skip to content

Commit

Permalink
chore: move commands definitions to a public function
Browse files Browse the repository at this point in the history
  • Loading branch information
jeronimoalbi committed Jan 12, 2024
1 parent cd5cfe2 commit 2e61fe7
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
26 changes: 14 additions & 12 deletions explorer/cmd/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,20 @@ package cmd

import "github.com/ignite/cli/v28/ignite/services/plugin"

// Commands contains the list of app commands.
var Commands = []*plugin.Command{
{
Use: "explorer [command]",
Short: "Run chain explorer commands",
Aliases: []string{"e"},
Commands: []*plugin.Command{
{
Use: "gex [rpc_url]",
Short: "Run gex",
Aliases: []string{"g"},
// GetCommands returns the list of explorer app commands.
func GetCommands() []*plugin.Command {
return []*plugin.Command{
{
Use: "explorer [command]",
Short: "Run chain explorer commands",
Aliases: []string{"e"},
Commands: []*plugin.Command{
{
Use: "gex [rpc_url]",
Short: "Run gex",
Aliases: []string{"g"},
},
},
},
},
}
}
2 changes: 1 addition & 1 deletion explorer/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type app struct{}
func (app) Manifest(context.Context) (*plugin.Manifest, error) {
return &plugin.Manifest{
Name: "explorer",
Commands: cmd.Commands,
Commands: cmd.GetCommands(),
}, nil
}

Expand Down

0 comments on commit 2e61fe7

Please sign in to comment.