Skip to content

Commit

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

* cl

* cl++

(cherry picked from commit 16a40f0)

# Conflicts:
#	ignite/cmd/chain_debug.go
  • Loading branch information
julienrbrt authored and mergify[bot] committed Aug 28, 2024
1 parent 6b6ecd0 commit ec0ae44
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

- [#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
- [#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)

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
5 changes: 5 additions & 0 deletions ignite/cmd/chain_debug.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,15 @@ func chainDebug(cmd *cobra.Command, session *cliui.Session) error {
chain.KeyringBackend(chaincmd.KeyringBackendTest),
}

<<<<<<< HEAD

Check failure on line 103 in ignite/cmd/chain_debug.go

View workflow job for this annotation

GitHub Actions / test network on ubuntu-latest

syntax error: unexpected <<, expected }

Check failure on line 103 in ignite/cmd/chain_debug.go

View workflow job for this annotation

GitHub Actions / test network on macos-latest

syntax error: unexpected <<, expected }

Check failure on line 103 in ignite/cmd/chain_debug.go

View workflow job for this annotation

GitHub Actions / Lint Go code

syntax error: unexpected <<, expected }

Check failure on line 103 in ignite/cmd/chain_debug.go

View workflow job for this annotation

GitHub Actions / Lint Go code

expected statement, found '<<' (typecheck)
config, err := cmd.Flags().GetString(flagConfig)
if err != nil {
return err
}
=======
// check if custom config is defined
config, _ := cmd.Flags().GetString(flagConfig)
>>>>>>> 16a40f0a (fix(cmd): add missing --config handling (#4323))

Check failure on line 111 in ignite/cmd/chain_debug.go

View workflow job for this annotation

GitHub Actions / test network on ubuntu-latest

invalid character U+0023 '#'

Check failure on line 111 in ignite/cmd/chain_debug.go

View workflow job for this annotation

GitHub Actions / test network on macos-latest

invalid character U+0023 '#'

Check failure on line 111 in ignite/cmd/chain_debug.go

View workflow job for this annotation

GitHub Actions / Lint Go code

invalid character U+0023 '#'
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 ec0ae44

Please sign in to comment.