Files
openclaw/scripts/e2e/parallels/macos-users.ts
2026-06-20 16:51:20 +02:00

14 lines
510 B
TypeScript

// macOS user helpers support Parallels guest fallback discovery.
export function parseMacosDsclUserHomeLine(line: string): { user: string; home: string } | null {
const match = /^(\S+)\s+(.+?)\s*$/u.exec(line.replaceAll("\r", ""));
if (!match) {
return null;
}
return { user: match[1], home: match[2] };
}
export function isLikelyMacosDesktopHome(home: string | undefined): boolean {
const normalized = home?.trim();
return Boolean(normalized) && /(?:^|\/)Users\/[^/]+$/u.test(normalized);
}