Skip to content

Commit

Permalink
minor
Browse files Browse the repository at this point in the history
  • Loading branch information
gitferry committed Dec 13, 2024
1 parent 1191343 commit 98321ab
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
3 changes: 0 additions & 3 deletions covenant-signer/cmd/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ import (
"github.com/spf13/cobra"
)

// PersistClientCtx persist some vars from the cmd or config to the client context.
// It gives preferences to flags over the values in the config. If the flag is not set
// and exists a value in the config that could be used, it will be set in the ctx.
func PersistClientCtx(ctx client.Context) func(cmd *cobra.Command, _ []string) error {
return func(cmd *cobra.Command, _ []string) error {
encCfg := params.DefaultEncodingConfig()
Expand Down
8 changes: 5 additions & 3 deletions covenant-signer/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (

"github.com/btcsuite/btcd/btcutil"
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/flags"
"github.com/spf13/cobra"
)

Expand All @@ -16,8 +17,8 @@ var (
// C:\Users\<username>\AppData\Local\signer on Windows
// ~/.signer on Linux
// ~/Library/Application Support/signer on MacOS
dafaultConfigDir = btcutil.AppDataDir("signer", false)
dafaultConfigPath = filepath.Join(dafaultConfigDir, "config.toml")
defaultConfigDir = btcutil.AppDataDir("signer", false)
defaultConfigPath = filepath.Join(defaultConfigDir, "config.toml")

rootCmd = NewRootCmd()
)
Expand All @@ -31,6 +32,7 @@ func NewRootCmd() *cobra.Command {
PersistentPreRunE: PersistClientCtx(client.Context{}),
}

cmd.PersistentFlags().String(flags.FlagHome, defaultConfigDir, "The application home directory")
return cmd
}

Expand All @@ -43,7 +45,7 @@ func init() {
rootCmd.PersistentFlags().StringVar(
&configPath,
configPathKey,
dafaultConfigPath,
defaultConfigPath,
"path to the configuration file",
)
}

0 comments on commit 98321ab

Please sign in to comment.