From aba706ea2d26c007a91e12512a2d0afe1d5e3a6f Mon Sep 17 00:00:00 2001 From: Michael Yang Date: Mon, 17 Jul 2023 14:14:34 -0700 Subject: [PATCH] remove unused persistent pre run --- cmd/cmd.go | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/cmd/cmd.go b/cmd/cmd.go index 99033614..344bea52 100644 --- a/cmd/cmd.go +++ b/cmd/cmd.go @@ -9,7 +9,6 @@ import ( "net" "net/http" "os" - "path/filepath" "strings" "time" @@ -21,15 +20,6 @@ import ( "github.com/jmorganca/ollama/server" ) -func cacheDir() string { - home, err := os.UserHomeDir() - if err != nil { - panic(err) - } - - return filepath.Join(home, ".ollama") -} - func create(cmd *cobra.Command, args []string) error { filename, _ := cmd.Flags().GetString("file") client := api.NewClient() @@ -255,10 +245,6 @@ func NewCLI() *cobra.Command { CompletionOptions: cobra.CompletionOptions{ DisableDefaultCmd: true, }, - PersistentPreRunE: func(_ *cobra.Command, args []string) error { - // create the models directory and it's parent - return os.MkdirAll(filepath.Join(cacheDir(), "models"), 0o700) - }, } cobra.EnableCommandSorting = false