react-native-legal 1.5.1 → 1.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -14,8 +14,17 @@ function addSettingsBundle(iosProjectPath) {
|
|
|
14
14
|
(0, ios_1.addSettingsBundleUtil)(iosProjectPath, ({ settingsBundleFilename }) => {
|
|
15
15
|
const projectName = (0, utils_1.getIOSProjectName)(iosProjectPath);
|
|
16
16
|
const { pbxproj, pbxprojPath } = (0, utils_1.getIOSPbxProj)(iosProjectPath);
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
let group = pbxproj.findPBXGroupKey({ name: projectName });
|
|
18
|
+
if (!group) {
|
|
19
|
+
// https://github.com/callstackincubator/react-native-legal/issues/81
|
|
20
|
+
// If the project name is wrapped in quotes inside pbxproj file, let's try to grab it
|
|
21
|
+
group = pbxproj.findPBXGroupKey({ name: `"${projectName}"` });
|
|
22
|
+
}
|
|
23
|
+
if (!group) {
|
|
24
|
+
throw new Error(`Could not find group named: ${projectName} in the pbxproj`);
|
|
25
|
+
}
|
|
26
|
+
pbxproj.removeFile(settingsBundleFilename, group);
|
|
27
|
+
const settingsBundleFile = pbxproj.addFile(settingsBundleFilename, group);
|
|
19
28
|
if (!settingsBundleFile) {
|
|
20
29
|
throw new Error('Could not add Settings.bundle file reference to xcode project');
|
|
21
30
|
}
|
|
@@ -12,9 +12,21 @@ export function addSettingsBundle(iosProjectPath: string) {
|
|
|
12
12
|
const projectName = getIOSProjectName(iosProjectPath);
|
|
13
13
|
const { pbxproj, pbxprojPath } = getIOSPbxProj(iosProjectPath);
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
let group: string | undefined = pbxproj.findPBXGroupKey({ name: projectName });
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
if (!group) {
|
|
18
|
+
// https://github.com/callstackincubator/react-native-legal/issues/81
|
|
19
|
+
// If the project name is wrapped in quotes inside pbxproj file, let's try to grab it
|
|
20
|
+
group = pbxproj.findPBXGroupKey({ name: `"${projectName}"` });
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
if (!group) {
|
|
24
|
+
throw new Error(`Could not find group named: ${projectName} in the pbxproj`);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
pbxproj.removeFile(settingsBundleFilename, group);
|
|
28
|
+
|
|
29
|
+
const settingsBundleFile = pbxproj.addFile(settingsBundleFilename, group);
|
|
18
30
|
|
|
19
31
|
if (!settingsBundleFile) {
|
|
20
32
|
throw new Error('Could not add Settings.bundle file reference to xcode project');
|