MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / readBundleIdentifier

Function readBundleIdentifier

apps/cli/src/service.ts:228–237  ·  view source on GitHub ↗
(appBundlePath: string)

Source from the content-addressed store, hash-verified

226};
227
228const readBundleIdentifier = (appBundlePath: string): string | null => {
229 try {
230 const plist = readFileSync(`${appBundlePath}/Contents/Info.plist`, "utf8");
231 const match = plist.match(/<key>\s*CFBundleIdentifier\s*<\/key>\s*<string>([^<]*)<\/string>/);
232 const bundleIdentifier = match ? xmlUnescape(match[1].trim()) : "";
233 return bundleIdentifier.length > 0 ? bundleIdentifier : null;
234 } catch {
235 return null;
236 }
237};
238
239const associatedBundleIdentifier = (programArguments: ReadonlyArray<string>): string | null => {
240 const executablePath = programArguments[0];

Callers 1

Calls 1

xmlUnescapeFunction · 0.85

Tested by

no test coverage detected