(path string)
| 52 | } |
| 53 | |
| 54 | func FixPath(path string) (string, error) { |
| 55 | origPath := path |
| 56 | var err error |
| 57 | if strings.HasPrefix(path, "~") { |
| 58 | path = filepath.Join(wavebase.GetHomeDir(), path[1:]) |
| 59 | } else if !filepath.IsAbs(path) { |
| 60 | path, err = filepath.Abs(path) |
| 61 | if err != nil { |
| 62 | return "", err |
| 63 | } |
| 64 | } |
| 65 | if strings.HasSuffix(origPath, "/") && !strings.HasSuffix(path, "/") { |
| 66 | path += "/" |
| 67 | } |
| 68 | return path, nil |
| 69 | } |
| 70 | |
| 71 | const ( |
| 72 | winFlagSoftlink = uint32(0x8000) // FILE_ATTRIBUTE_REPARSE_POINT |
no test coverage detected