mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-23 11:08:13 +00:00
14 lines
510 B
TypeScript
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);
|
|
}
|