Skip to content

Commit

Permalink
feat(templates): improve default home (#4210)
Browse files Browse the repository at this point in the history
* feat(templates): improve default home

* changelog

* changelog

* dont create home flag everywhere
  • Loading branch information
julienrbrt committed Jun 26, 2024
1 parent 4fa95b0 commit 0f311a6
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 17 deletions.
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
- [#4162](https://github.com/ignite/cli/pull/4162) Enable errcheck linter
- [#4194](https://github.com/ignite/cli/pull/4194) Bump client/v2 to `v2.0.0-beta.2`
- [#4189](https://github.com/ignite/cli/pull/4189) Deprecate `ignite node` for `ignite connect` app
- [#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 @@ -134,12 +133,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 @@ -79,12 +78,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 @@ -145,12 +144,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

0 comments on commit 0f311a6

Please sign in to comment.