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
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
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, "~/") {