remove unused persistent pre run
This commit is contained in:
parent
529ff9ab6d
commit
aba706ea2d
1 changed files with 0 additions and 14 deletions
14
cmd/cmd.go
14
cmd/cmd.go
|
@ -9,7 +9,6 @@ import (
|
||||||
"net"
|
"net"
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
@ -21,15 +20,6 @@ import (
|
||||||
"github.com/jmorganca/ollama/server"
|
"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 {
|
func create(cmd *cobra.Command, args []string) error {
|
||||||
filename, _ := cmd.Flags().GetString("file")
|
filename, _ := cmd.Flags().GetString("file")
|
||||||
client := api.NewClient()
|
client := api.NewClient()
|
||||||
|
@ -255,10 +245,6 @@ func NewCLI() *cobra.Command {
|
||||||
CompletionOptions: cobra.CompletionOptions{
|
CompletionOptions: cobra.CompletionOptions{
|
||||||
DisableDefaultCmd: true,
|
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
|
cobra.EnableCommandSorting = false
|
||||||
|
|
Loading…
Reference in a new issue