Function
checkWSLDistroMatch
(
windowsPath: string,
wslDistroName: string,
)
Source from the content-addressed store, hash-verified
| 79 | * Check if distro names match for WSL UNC paths |
| 80 | */ |
| 81 | export function checkWSLDistroMatch( |
| 82 | windowsPath: string, |
| 83 | wslDistroName: string, |
| 84 | ): boolean { |
| 85 | const wslUncMatch = windowsPath.match( |
| 86 | /^\\\\wsl(?:\.localhost|\$)\\([^\\]+)(.*)$/, |
| 87 | ) |
| 88 | if (wslUncMatch) { |
| 89 | return wslUncMatch[1] === wslDistroName |
| 90 | } |
| 91 | return true // Not a WSL UNC path, so no distro mismatch |
| 92 | } |
Tested by
no test coverage detected