fix(native): normalize otool line endings and strip plist JSON BOM (#533)

This commit is contained in:
morluto
2026-10-05 15:28:31 +08:00
committed by GitHub
parent 0f77ada55e
commit 3e4d4d93fd
3 changed files with 50 additions and 2 deletions
+2 -1
View File
@@ -4,7 +4,8 @@ const plistObject = z.record(z.string(), z.unknown());
/** Parse plutil JSON output and project stable bundle metadata. */
export const parsePlistJson = (output: string) => {
const value: unknown = JSON.parse(output);
// plutil output can carry a UTF-8 BOM, which JSON.parse rejects outright.
const value: unknown = JSON.parse(output.replace(/^\uFEFF/u, ""));
const object = plistObject.safeParse(value);
const field = (name: string): string | null => {
if (!object.success) return null;