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

fix(cmd): add missing --config handling (backport #4323) #4325

Merged
merged 3 commits into from
Aug 29, 2024
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
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
Loading