Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: move commands definitions to a public function
Browse files Browse the repository at this point in the history
jeronimoalbi committed Jan 12, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent cd5cfe2 commit 2e61fe7
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
@@ -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
@@ -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
}

0 comments on commit 2e61fe7

Please sign in to comment.