Skip to content

Commit cd177f2

Browse files
committed
fix temp dir creation
1 parent 865a449 commit cd177f2

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

cmd/odind/cmd/root.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ import (
3737
sdk "github.com/cosmos/cosmos-sdk/types"
3838
"github.com/cosmos/cosmos-sdk/types/tx/signing"
3939
authtxconfig "github.com/cosmos/cosmos-sdk/x/auth/tx/config"
40-
"github.com/cosmos/ibc-go/v8/testing/simapp"
4140
)
4241

4342
const (
@@ -47,7 +46,9 @@ const (
4746
// NewRootCmd creates a new root command for simd. It is called once in the
4847
// main function.
4948
func NewRootCmd() (rootCMD *cobra.Command, params params.EncodingConfig) {
50-
tempApp := app.NewOdinApp(log.NewNopLogger(), dbm.NewMemDB(), nil, true, map[int64]bool{}, simtestutil.NewAppOptionsWithFlagHome(tempDir()), 100)
49+
temp := tempDir()
50+
defer os.RemoveAll(temp)
51+
tempApp := app.NewOdinApp(log.NewNopLogger(), dbm.NewMemDB(), nil, true, map[int64]bool{}, simtestutil.NewAppOptionsWithFlagHome(temp), 100)
5152
encodingConfig := app.MakeEncodingConfig()
5253

5354
initClientCtx := client.Context{}.
@@ -290,9 +291,8 @@ func appExport(
290291
var tempDir = func() string {
291292
dir, err := os.MkdirTemp("", "simapp")
292293
if err != nil {
293-
dir = simapp.DefaultNodeHome
294+
panic("failed to create temp dir: " + err.Error())
294295
}
295-
defer os.RemoveAll(dir)
296296

297297
return dir
298298
}

0 commit comments

Comments
 (0)