use filepath for os compat

This commit is contained in:
Michael Yang
2023-07-14 17:27:14 -07:00
parent 560f36e6c8
commit 743e957d88
3 changed files with 13 additions and 13 deletions

View File

@@ -9,7 +9,7 @@ import (
"net"
"net/http"
"os"
"path"
"path/filepath"
"strings"
"time"
@@ -27,7 +27,7 @@ func cacheDir() string {
panic(err)
}
return path.Join(home, ".ollama")
return filepath.Join(home, ".ollama")
}
func RunRun(cmd *cobra.Command, args []string) error {
@@ -209,7 +209,7 @@ func NewCLI() *cobra.Command {
},
PersistentPreRunE: func(_ *cobra.Command, args []string) error {
// create the models directory and it's parent
return os.MkdirAll(path.Join(cacheDir(), "models"), 0o700)
return os.MkdirAll(filepath.Join(cacheDir(), "models"), 0o700)
},
}