Skip to content

Commit

Permalink
rename the util function so that easier understanding.
Browse files Browse the repository at this point in the history
  • Loading branch information
HoytRen committed Nov 28, 2022
1 parent 1293b3b commit 1dcecc6
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cmd/celestia/bridge.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@ var bridgeCmd = &cobra.Command{
Args: cobra.NoArgs,
Short: "Manage your Bridge node",
PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
return persistentPreRunE(cmd, node.Bridge, args)
return persistentPreRunEnv(cmd, node.Bridge, args)
},
}
2 changes: 1 addition & 1 deletion cmd/celestia/full.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,6 @@ var fullCmd = &cobra.Command{
Args: cobra.NoArgs,
Short: "Manage your Full node",
PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
return persistentPreRunE(cmd, node.Full, args)
return persistentPreRunEnv(cmd, node.Full, args)
},
}
2 changes: 1 addition & 1 deletion cmd/celestia/light.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,6 @@ var lightCmd = &cobra.Command{
Args: cobra.NoArgs,
Short: "Manage your Light node",
PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
return persistentPreRunE(cmd, node.Light, args)
return persistentPreRunEnv(cmd, node.Light, args)
},
}
3 changes: 2 additions & 1 deletion cmd/celestia/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"github.com/spf13/cobra"
)

func persistentPreRunE(cmd *cobra.Command, nodeType node.Type, args []string) error {
func persistentPreRunEnv(cmd *cobra.Command, nodeType node.Type, args []string) error {
var (
ctx = cmd.Context()
err error
Expand All @@ -26,6 +26,7 @@ func persistentPreRunE(cmd *cobra.Command, nodeType node.Type, args []string) er
}
ctx = cmdnode.WithNetwork(ctx, parsedNetwork)

// loads existing config into the environment
ctx, err = cmdnode.ParseNodeFlags(ctx, cmd, cmdnode.Network(ctx))
if err != nil {
return err
Expand Down

0 comments on commit 1dcecc6

Please sign in to comment.