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