MCPcopy Create free account
hub / github.com/auth0/auth0-cli / extractPbxprojBundleID

Function extractPbxprojBundleID

internal/cli/quickstart_detect.go:557–574  ·  view source on GitHub ↗

extractPbxprojBundleID extracts PRODUCT_BUNDLE_IDENTIFIER from project.pbxproj, skipping test-target bundle IDs (those ending in "Tests").

(content string)

Source from the content-addressed store, hash-verified

555// extractPbxprojBundleID extracts PRODUCT_BUNDLE_IDENTIFIER from project.pbxproj,
556// skipping test-target bundle IDs (those ending in "Tests").
557func extractPbxprojBundleID(content string) string {
558 all := pbxprojBundleIDRegex.FindAllStringSubmatch(content, -1)
559 for _, m := range all {
560 if len(m) < 2 {
561 continue
562 }
563 id := strings.TrimSpace(m[1])
564 // Skip test-target bundle IDs. In Xcode-generated project.pbxproj files,
565 // test targets appear before the app target. Both dotted suffixes
566 // (com.example.app.Tests, com.example.app.UITests) and concatenated
567 // suffixes (com.example.appTests) all end in "Tests".
568 if strings.HasSuffix(id, "Tests") {
569 continue
570 }
571 return id
572 }
573 return ""
574}
575
576// infoPlistBundleIDRegex matches <key>CFBundleIdentifier</key> followed by <string>value</string>.
577var infoPlistBundleIDRegex = regexp.MustCompile(`<key>CFBundleIdentifier</key>\s*<string>([^<]+)</string>`)

Callers 2

readIOSBundleIDFunction · 0.85

Calls

no outgoing calls

Tested by 1