diff --git a/changelog.md b/changelog.md index 375fa2de86..293134554c 100644 --- a/changelog.md +++ b/changelog.md @@ -7,6 +7,10 @@ - [#4292](https://github.com/ignite/cli/pull/4292) Bump Cosmos SDK to `v0.50.9` - [#4309](https://github.com/ignite/cli/pull/4309) Fix chain id for chain simulations +### Fixes + +- [#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) ### Features diff --git a/ignite/cmd/chain_build.go b/ignite/cmd/chain_build.go index 6b89b0a6ca..e5bca7fdd2 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 10c4fa63f5..f7bd847dcd 100644 --- a/ignite/cmd/chain_debug.go +++ b/ignite/cmd/chain_debug.go @@ -100,10 +100,8 @@ func chainDebug(cmd *cobra.Command, session *cliui.Session) error { chain.KeyringBackend(chaincmd.KeyringBackendTest), } - config, err := cmd.Flags().GetString(flagConfig) - if err != nil { - return err - } + // 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 335d33d8fc..aa8fb12c0d 100644 --- a/ignite/cmd/chain_faucet.go +++ b/ignite/cmd/chain_faucet.go @@ -39,6 +39,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 0f61505fc3..9e2e0df825 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