Skip to content

Commit 447becb

Browse files
committed
Fix bundle identifiers
1 parent 3690bd1 commit 447becb

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

.changeset/tall-tips-fail.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"gyp-to-cmake": patch
3+
---
4+
5+
Fixed escaping bundle ids to no longer contain "_"

packages/gyp-to-cmake/src/transformer.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,12 @@ function escapeSpaces(source: string) {
2727
return source.replace(/ /g, "\\ ");
2828
}
2929

30-
function escapeBundleIdentifier(identifier: string) {
31-
return identifier.replaceAll("__", ".").replace(/[^A-Za-z0-9.-_]/g, "-");
30+
/**
31+
* Escapes any input to match a CFBundleIdentifier
32+
* See https://developer.apple.com/documentation/bundleresources/information-property-list/cfbundleidentifier
33+
*/
34+
export function escapeBundleIdentifier(input: string) {
35+
return input.replaceAll("__", ".").replace(/[^A-Za-z0-9-.]/g, "-");
3236
}
3337

3438
/**

0 commit comments

Comments
 (0)