MCPcopy Create free account
hub / github.com/heygen-com/hyperframes / detectWSL

Function detectWSL

packages/cli/src/telemetry/platform.ts:8–18  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

6// to avoid an import cycle between those two files.
7
8export function detectWSL(): boolean {
9 if (platform() !== "linux") return false;
10 try {
11 const osRelease = release().toLowerCase();
12 if (osRelease.includes("microsoft") || osRelease.includes("wsl")) return true;
13 const procVersion = readFileSync("/proc/version", "utf-8").toLowerCase();
14 return procVersion.includes("microsoft") || procVersion.includes("wsl");
15 } catch {
16 return false;
17 }
18}

Callers 3

detectLinuxDistroFunction · 0.85
getSystemMetaFunction · 0.85
detectSandboxRuntimeFunction · 0.85

Calls 1

releaseFunction · 0.85

Tested by

no test coverage detected