Skip to content

Commit

Permalink
fix(cmd): add missing --config handling (backport #4323) (#4325)
Browse files Browse the repository at this point in the history
* fix(cmd): add missing --config handling (#4323)

* fix(cmd): add missing `--config` handling

* cl

* cl++

(cherry picked from commit 16a40f0)

# Conflicts:
#	ignite/cmd/chain_debug.go

* updates

* cl

---------

Co-authored-by: Julien Robert <[email protected]>
  • Loading branch information
mergify[bot] and julienrbrt authored Aug 29, 2024
1 parent 6b6ecd0 commit cb7b4a0
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 4 deletions.
4 changes: 4 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions ignite/cmd/chain_build.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 2 additions & 4 deletions ignite/cmd/chain_debug.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}
Expand Down
5 changes: 5 additions & 0 deletions ignite/cmd/chain_faucet.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions ignite/cmd/chain_init.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit cb7b4a0

Please sign in to comment.