From 38847413d70d4d05c6fa291e734134e328589095 Mon Sep 17 00:00:00 2001 From: Harish Marri Date: Thu, 19 Sep 2024 15:12:54 +0530 Subject: [PATCH] fix node temp home issue --- cmd/omniflixhubd/cmd/root.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/cmd/omniflixhubd/cmd/root.go b/cmd/omniflixhubd/cmd/root.go index bf74b08..42492b9 100644 --- a/cmd/omniflixhubd/cmd/root.go +++ b/cmd/omniflixhubd/cmd/root.go @@ -4,6 +4,7 @@ import ( "errors" "io" "os" + "path/filepath" "github.com/cosmos/cosmos-sdk/baseapp" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" @@ -178,10 +179,7 @@ func addModuleInitFlags(startCmd *cobra.Command) { } func tempDir() string { - dir, err := os.MkdirTemp("", "omniflixhubtemp") - if err != nil { - dir = app.DefaultNodeHome - } + dir := filepath.Join(os.TempDir(), "."+app.Name+"-temp") defer os.RemoveAll(dir) return dir