Skip to content

Commit 1d90d42

Browse files
committed
fix command init
1 parent bcf3029 commit 1d90d42

File tree

1 file changed

+2
-22
lines changed

1 file changed

+2
-22
lines changed

cmd/git-gitopia/root.go

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,9 @@
11
package main
22

33
import (
4-
"os"
5-
6-
"github.com/cosmos/cosmos-sdk/client"
74
"github.com/cosmos/cosmos-sdk/client/keys"
8-
"github.com/cosmos/cosmos-sdk/codec"
9-
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
10-
cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec"
11-
sdk "github.com/cosmos/cosmos-sdk/types"
125
"github.com/gitopia/git-remote-gitopia/cmd/git-gitopia/lfs"
6+
"github.com/gitopia/gitopia-go"
137
"github.com/spf13/cobra"
148
)
159

@@ -18,21 +12,7 @@ func RootCommand() *cobra.Command {
1812
Use: "gitopia",
1913
CompletionOptions: cobra.CompletionOptions{DisableDefaultCmd: true},
2014
PersistentPreRunE: func(cmd *cobra.Command, _ []string) error {
21-
conf := sdk.GetConfig()
22-
conf.SetBech32PrefixForAccount(AccountAddressPrefix, AccountAddressPrefix+sdk.PrefixPublic)
23-
conf.Seal()
24-
25-
registry := codectypes.NewInterfaceRegistry()
26-
cryptocodec.RegisterInterfaces(registry)
27-
marshaler := codec.NewProtoCodec(registry)
28-
29-
initClientCtx := client.GetClientContextFromCmd(cmd).
30-
WithCodec(marshaler).
31-
WithInterfaceRegistry(registry).
32-
WithInput(os.Stdin)
33-
34-
// sets global flags for keys subcommand
35-
return client.SetCmdClientContextHandler(initClientCtx, cmd)
15+
return gitopia.CommandInit(cmd, AppName)
3616
},
3717
}
3818
cmd.AddCommand(keys.Commands("."))

0 commit comments

Comments
 (0)