IsOnWindowsPartitionPath returns true if the provided path is on a Windows partition in WSL (typically paths mounted under /mnt/*)
(path string)
| 34 | // IsOnWindowsPartitionPath returns true if the provided path is on a Windows partition |
| 35 | // in WSL (typically paths mounted under /mnt/*) |
| 36 | func IsOnWindowsPartitionPath(path string) bool { |
| 37 | absPath, err := filepath.Abs(path) |
| 38 | if err != nil { |
| 39 | return false |
| 40 | } |
| 41 | return strings.HasPrefix(absPath, "/mnt/") |
| 42 | } |
| 43 | |
| 44 | // IsWSLWindowsPartition checks if the user is running on a Windows partition inside WSL |
| 45 | // Returns true if both conditions are met |
no outgoing calls
no test coverage detected