Skip to content

Commit

Permalink
fix: Local-interchain cleanup (#710)
Browse files Browse the repository at this point in the history
* Fix compiler error

* Use go run in Makefile

Prevents needing to build the binary first.

* Remove unecessary init functions

* Remove unecessary global var

* Fix misspelling in var name

* Revert "Remove unecessary global var"

This reverts commit 20cf604.

* Add comment for why InstallDir must be public

---------

Co-authored-by: Reece Williams <[email protected]>
(cherry picked from commit 5c4c2b6)
  • Loading branch information
DavidNix authored and mergify[bot] committed Sep 27, 2023
1 parent 4b00048 commit 6dc2117
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 13 deletions.
2 changes: 1 addition & 1 deletion local-interchain/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ build:

.PHONY: run
run:
../bin/local-ic $(filter-out $@,$(MAKECMDGOALS))
go run ./cmd/local-ic $(filter-out $@,$(MAKECMDGOALS))

.PHONY: install
install:
Expand Down
4 changes: 0 additions & 4 deletions local-interchain/cmd/local-ic/chains.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,3 @@ func GetFiles() []string {

return fileNames
}

func init() {
rootCmd.AddCommand(chainsCmd)
}
4 changes: 4 additions & 0 deletions local-interchain/cmd/local-ic/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ import (
)

func main() {
rootCmd.AddCommand(chainsCmd)
rootCmd.AddCommand(newChainCmd)
rootCmd.AddCommand(startCmd)

if err := rootCmd.Execute(); err != nil {
fmt.Fprintf(os.Stderr, "error while executing your CLI. Err: %v\n", err)
os.Exit(1)
Expand Down
4 changes: 0 additions & 4 deletions local-interchain/cmd/local-ic/new_chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,3 @@ func getOrDefault[T any](output string, defaultVal T) T {

return any(text).(T)
}

func init() {
rootCmd.AddCommand(newChainCmd)
}
1 change: 1 addition & 0 deletions local-interchain/cmd/local-ic/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
)

var (
// This must be global for the Makefile to build properly (ldflags).
MakeFileInstallDirectory string
)

Expand Down
4 changes: 0 additions & 4 deletions local-interchain/cmd/local-ic/start_chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,3 @@ var startCmd = &cobra.Command{
interchain.StartChain(parentDir, configPath)
},
}

func init() {
rootCmd.AddCommand(startCmd)
}

0 comments on commit 6dc2117

Please sign in to comment.