Get up and running with Kimi, GLM, MiniMax, DeepSeek, gpt-oss, Qwen, Gemma and other models.
create `.ollama` directory if it doesnt exist
Jeffrey Morgan1556162c903f
diff --git a/cmd/cmd.go b/cmd/cmd.goindex 3683b1d39..53c039baa 100644--- a/cmd/cmd.go+++ b/cmd/cmd.go@@ -9,12 +9,12 @@ import ("errors""fmt""io"- "io/ioutil""log""net""net/http""os""os/exec"+ "path""path/filepath""runtime""strings"@@ -585,7 +585,12 @@ func initializeKeypair() error {return err}- err = ioutil.WriteFile(privKeyPath, pem.EncodeToMemory(privKeyBytes), 0600)+ err = os.MkdirAll(path.Dir(privKeyPath), 0o700)+ if err != nil {+ return fmt.Errorf("could not create directory %w", err)+ }++ err = os.WriteFile(privKeyPath, pem.EncodeToMemory(privKeyBytes), 0600)if err != nil {return err}@@ -597,7 +602,7 @@ func initializeKeypair() error {pubKeyData := ssh.MarshalAuthorizedKey(sshPrivateKey.PublicKey())- err = ioutil.WriteFile(pubKeyPath, pubKeyData, 0644)+ err = os.WriteFile(pubKeyPath, pubKeyData, 0644)if err != nil {return err}diff --git a/server/auth.go b/server/auth.goindex f5aaa6b1e..f24c46afe 100644--- a/server/auth.go+++ b/server/auth.go@@ -63,11 +63,6 @@ func getAuthToken(redirData AuthRedirect, regOpts *RegistryOptions) (string, errkeyPath := path.Join(home, ".ollama", "id_ed25519")- err = os.MkdirAll(path.Dir(keyPath), 0700)- if err != nil {- return "", fmt.Errorf("could not create .ollama directory %w", err)- }-rawKey, err := os.ReadFile(keyPath)if err != nil {log.Printf("Failed to load private key: %v", err)