Skip to content

Commit

Permalink
merge updates from main
Browse files Browse the repository at this point in the history
  • Loading branch information
harish551 committed Sep 20, 2024
2 parents 3884741 + 6195561 commit 3f401e9
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions cmd/omniflixhubd/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package cmd

import (
"errors"
"fmt"
"io"
"os"
"path/filepath"
Expand Down Expand Up @@ -73,6 +74,9 @@ func NewRootCmd() (*cobra.Command, params.EncodingConfig) {
if err := tempApp.Close(); err != nil {
panic(err)
}
if tempDir != app.DefaultNodeHome {
os.RemoveAll(tempDir)
}
}()

initClientCtx := client.Context{}.
Expand Down Expand Up @@ -179,7 +183,14 @@ func addModuleInitFlags(startCmd *cobra.Command) {
}

func tempDir() string {
<<<<<<< HEAD
dir := filepath.Join(os.TempDir(), "."+app.Name+"-temp")
=======
dir, err := os.MkdirTemp("", "."+app.Name+"-temp")
if err != nil {
panic(fmt.Sprintf("failed creating temp directory: %s", err.Error()))
}
>>>>>>> main
defer os.RemoveAll(dir)

return dir
Expand Down

0 comments on commit 3f401e9

Please sign in to comment.