Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure version command runs on all binaries #779

Merged
merged 2 commits into from
Mar 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ tests:
build: clean
go run helper/heimdall-params.template.go $(network)
mkdir -p build
go build -o build/heimdalld ./cmd/heimdalld
go build -o build/heimdallcli ./cmd/heimdallcli
go build -o build/bridge bridge/bridge.go
go build $(BUILD_FLAGS) -o build/heimdalld ./cmd/heimdalld
go build $(BUILD_FLAGS) -o build/heimdallcli ./cmd/heimdallcli
go build $(BUILD_FLAGS) -o build/bridge bridge/bridge.go
@echo "====================================================\n==================Build Successful==================\n===================================================="

# make install Will generate for mainnet by default
Expand Down
8 changes: 6 additions & 2 deletions bridge/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"github.com/spf13/viper"

"github.com/maticnetwork/heimdall/helper"
"github.com/maticnetwork/heimdall/version"
)

const (
Expand All @@ -21,8 +22,10 @@ var rootCmd = &cobra.Command{
Use: "heimdall-bridge",
Short: "Heimdall bridge deamon",
PersistentPreRun: func(cmd *cobra.Command, args []string) {
// initialize tendermint viper config
InitTendermintViperConfig(cmd)
if cmd.Use != version.Cmd.Use {
// initialize tendermint viper config
InitTendermintViperConfig(cmd)
}
},
}

Expand Down Expand Up @@ -61,6 +64,7 @@ func Execute() {

func init() {
var logger = helper.Logger.With("module", "bridge/cmd/")
rootCmd.AddCommand(version.Cmd)
rootCmd.PersistentFlags().StringP(helper.NodeFlag, "n", "tcp://localhost:26657", "Node to connect to")
rootCmd.PersistentFlags().String(helper.HomeFlag, os.ExpandEnv("$HOME/.heimdalld"), "directory for config and data")
rootCmd.PersistentFlags().String(
Expand Down
6 changes: 4 additions & 2 deletions cmd/heimdallcli/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,10 @@ var (
Use: "heimdallcli",
Short: "Heimdall light-client",
PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
// initialise config
initTendermintViperConfig(cmd)
if cmd.Use != version.Cmd.Use {
// initialise config
initTendermintViperConfig(cmd)
}
return nil
},
}
Expand Down