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

feat(templates): improve default home (backport #4210) #4213

Merged
merged 2 commits into from
Jun 27, 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
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
- [#4178](https://github.com/ignite/cli/pull/4178) Bump cosmos-sdk to `v0.50.7`
- [#4194](https://github.com/ignite/cli/pull/4194) Bump client/v2 to `v2.0.0-beta.2`
If you are uprading manually, check out the recommended changes in `root.go` from the above PR.
- [#4210](https://github.com/ignite/cli/pull/4210) Improve default home wiring

### Fixes

Expand Down
8 changes: 3 additions & 5 deletions ignite/templates/app/files-consumer/app/app.go.plush
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@ package app

import (
"io"
"os"
"path/filepath"
"fmt"

clienthelpers "cosmossdk.io/client/v2/helpers"
"cosmossdk.io/depinject"
"cosmossdk.io/log"
storetypes "cosmossdk.io/store/types"
Expand Down Expand Up @@ -135,12 +134,11 @@ type App struct {
}

func init() {
userHomeDir, err := os.UserHomeDir()
var err error
DefaultNodeHome, err = clienthelpers.GetNodeHomeDirectory("."+Name)
if err != nil {
panic(err)
}

DefaultNodeHome = filepath.Join(userHomeDir, "."+Name)
}

// AppConfig returns the default app config.
Expand Down
8 changes: 3 additions & 5 deletions ignite/templates/app/files-minimal/app/app.go.plush
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ package app

import (
"io"
"os"
"path/filepath"

clienthelpers "cosmossdk.io/client/v2/helpers"
"cosmossdk.io/depinject"
"cosmossdk.io/log"
storetypes "cosmossdk.io/store/types"
Expand Down Expand Up @@ -81,12 +80,11 @@ type App struct {
}

func init() {
userHomeDir, err := os.UserHomeDir()
var err error
DefaultNodeHome, err = clienthelpers.GetNodeHomeDirectory("."+Name)
if err != nil {
panic(err)
}

DefaultNodeHome = filepath.Join(userHomeDir, "."+Name)
}

// AppConfig returns the default app config.
Expand Down
8 changes: 3 additions & 5 deletions ignite/templates/app/files/app/app.go.plush
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ package app

import (
"io"
"os"
"path/filepath"

clienthelpers "cosmossdk.io/client/v2/helpers"
"cosmossdk.io/depinject"
"cosmossdk.io/log"
storetypes "cosmossdk.io/store/types"
Expand Down Expand Up @@ -147,12 +146,11 @@ type App struct {
}

func init() {
userHomeDir, err := os.UserHomeDir()
var err error
DefaultNodeHome, err = clienthelpers.GetNodeHomeDirectory("."+Name)
if err != nil {
panic(err)
}

DefaultNodeHome = filepath.Join(userHomeDir, "."+Name)
}

// getGovProposalHandlers return the chain proposal handlers.
Expand Down
4 changes: 2 additions & 2 deletions ignite/templates/app/files/go.mod.plush
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ replace (

require (
cosmossdk.io/api v0.7.5
cosmossdk.io/client/v2 v2.0.0-beta.2
cosmossdk.io/client/v2 v2.0.0-beta.2.0.20240625200423-e4c342eb99f5
cosmossdk.io/collections v0.4.0
cosmossdk.io/core v0.11.0
cosmossdk.io/depinject v1.0.0-alpha.4
Expand All @@ -23,7 +23,7 @@ require (
cosmossdk.io/x/evidence v0.1.0
cosmossdk.io/x/feegrant v0.1.0
cosmossdk.io/x/nft v0.1.0
cosmossdk.io/x/upgrade v0.1.3
cosmossdk.io/x/upgrade v0.1.4-0.20240625200423-e4c342eb99f5
<%= if (IsConsumerChain) { %>
github.com/cosmos/interchain-security/v5 v5.0.0
<% } %>
Expand Down
Loading