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

Function readBundleIdentifier

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

Source from the content-addressed store, hash-verified

237};
238
239const readBundleIdentifier = (appBundlePath: string): string | null => {
240 try {
241 const plist = readFileSync(`${appBundlePath}/Contents/Info.plist`, "utf8");
242 const match = plist.match(/<key>\s*CFBundleIdentifier\s*<\/key>\s*<string>([^<]*)<\/string>/);
243 const bundleIdentifier = match ? xmlUnescape(match[1].trim()) : "";
244 return bundleIdentifier.length > 0 ? bundleIdentifier : null;
245 } catch {
246 return null;
247 }
248};
249
250const associatedBundleIdentifier = (programArguments: ReadonlyArray<string>): string | null => {
251 const executablePath = programArguments[0];

Callers 1

Calls 1

xmlUnescapeFunction · 0.85

Tested by

no test coverage detected