Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
julienrbrt committed Nov 2, 2023
1 parent 53b6188 commit f90d7e1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 2 additions & 0 deletions client/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"fmt"
"io"
"os"
"strings"

"github.com/cosmos/gogoproto/proto"
"github.com/spf13/viper"
Expand Down Expand Up @@ -286,6 +287,7 @@ func (ctx Context) WithViper(prefix string) Context {
}

v.SetEnvPrefix(prefix)
v.SetEnvKeyReplacer(strings.NewReplacer(".", "_", "-", "_"))
v.AutomaticEnv()
ctx.Viper = v
return ctx
Expand Down
3 changes: 1 addition & 2 deletions client/tx/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@ type Factory struct {
// NewFactoryCLI creates a new Factory.
func NewFactoryCLI(clientCtx client.Context, flagSet *pflag.FlagSet) (Factory, error) {
if clientCtx.Viper == nil {
executableName, _ := os.Executable()
clientCtx.WithViper(executableName)
clientCtx = clientCtx.WithViper("")
}

if err := clientCtx.Viper.BindPFlags(flagSet); err != nil {
Expand Down

0 comments on commit f90d7e1

Please sign in to comment.