From 16a40f0a91b31cca31b42cd6b1d5f7b324b061c4 Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Wed, 28 Aug 2024 21:52:09 +0000 Subject: [PATCH] fix(cmd): add missing --config handling (#4323) * fix(cmd): add missing `--config` handling * cl * cl++ --- changelog.md | 1 + ignite/cmd/chain_build.go | 6 ++++++ ignite/cmd/chain_debug.go | 1 + ignite/cmd/chain_faucet.go | 5 +++++ ignite/cmd/chain_init.go | 6 ++++++ 5 files changed, 19 insertions(+) diff --git a/changelog.md b/changelog.md index 246e8d93b7..c55031feed 100644 --- a/changelog.md +++ b/changelog.md @@ -44,6 +44,7 @@ - [#4091](https://github.com/ignite/cli/pull/4091) Fix race conditions in the plugin logic - [#4128](https://github.com/ignite/cli/pull/4128) Check for duplicate proto fields in config - [#4309](https://github.com/ignite/cli/pull/4309) Fix chain id for chain simulations +- [#4323](https://github.com/ignite/cli/pull/4323) Add missing `--config` handling in the `chain` commands ## [`v28.5.1`](https://github.com/ignite/cli/releases/tag/v28.5.1) diff --git a/ignite/cmd/chain_build.go b/ignite/cmd/chain_build.go index 470769161d..b72156e240 100644 --- a/ignite/cmd/chain_build.go +++ b/ignite/cmd/chain_build.go @@ -123,6 +123,12 @@ func chainBuildHandler(cmd *cobra.Command, _ []string) error { chainOption = append(chainOption, chain.CheckDependencies()) } + // check if custom config is defined + config, _ := cmd.Flags().GetString(flagConfig) + if config != "" { + chainOption = append(chainOption, chain.ConfigFile(config)) + } + c, err := chain.NewWithHomeFlags(cmd, chainOption...) if err != nil { return err diff --git a/ignite/cmd/chain_debug.go b/ignite/cmd/chain_debug.go index 37220aa0e1..fe84548cd3 100644 --- a/ignite/cmd/chain_debug.go +++ b/ignite/cmd/chain_debug.go @@ -100,6 +100,7 @@ func chainDebug(cmd *cobra.Command, session *cliui.Session) error { chain.KeyringBackend(chaincmd.KeyringBackendTest), } + // check if custom config is defined config, _ := cmd.Flags().GetString(flagConfig) if config != "" { chainOptions = append(chainOptions, chain.ConfigFile(config)) diff --git a/ignite/cmd/chain_faucet.go b/ignite/cmd/chain_faucet.go index 4e2515dedc..ecc858bbf1 100644 --- a/ignite/cmd/chain_faucet.go +++ b/ignite/cmd/chain_faucet.go @@ -40,6 +40,11 @@ func chainFaucetHandler(cmd *cobra.Command, args []string) error { chain.CollectEvents(session.EventBus()), } + config, _ := cmd.Flags().GetString(flagConfig) + if config != "" { + chainOption = append(chainOption, chain.ConfigFile(config)) + } + c, err := chain.NewWithHomeFlags(cmd, chainOption...) if err != nil { return err diff --git a/ignite/cmd/chain_init.go b/ignite/cmd/chain_init.go index 9a40fecd61..440d048b10 100644 --- a/ignite/cmd/chain_init.go +++ b/ignite/cmd/chain_init.go @@ -112,6 +112,12 @@ func chainInitHandler(cmd *cobra.Command, _ []string) error { chainOption = append(chainOption, chain.CheckDependencies()) } + // check if custom config is defined + config, _ := cmd.Flags().GetString(flagConfig) + if config != "" { + chainOption = append(chainOption, chain.ConfigFile(config)) + } + c, err := chain.NewWithHomeFlags(cmd, chainOption...) if err != nil { return err