Fix absolute path names + gguf detection (#8428)

This commit is contained in:
Patrick Devine
2025-01-14 19:01:24 -08:00
committed by GitHub
parent 61676fb506
commit 2539f2dbf9
4 changed files with 217 additions and 28 deletions

View File

@@ -564,7 +564,9 @@ func isValidCommand(cmd string) bool {
}
func expandPathImpl(path, relativeDir string, currentUserFunc func() (*user.User, error), lookupUserFunc func(string) (*user.User, error)) (string, error) {
if strings.HasPrefix(path, "~") {
if filepath.IsAbs(path) || strings.HasPrefix(path, "\\") || strings.HasPrefix(path, "/") {
return filepath.Abs(path)
} else if strings.HasPrefix(path, "~") {
var homeDir string
if path == "~" || strings.HasPrefix(path, "~/") {