Skip to content

Commit c818b94

Browse files
committed
Early guard.
1 parent e43564e commit c818b94

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/withUseFrameworks.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ const pkg = { name: '@journeyapps/react-native-quick-sqlite', version: 'UNVERSIO
77

88
// Function to modify the Podfile
99
function modifyPodfile(podfilePath: string, staticLibrary: boolean) {
10+
if (!staticLibrary) {
11+
return;
12+
}
13+
1014
let podfile = fs.readFileSync(podfilePath, 'utf8');
1115
const preinstallScript = `
1216
pre_install do |installer|
@@ -20,7 +24,7 @@ pre_install do |installer|
2024
end
2125
`;
2226
// Ensure script is added only once
23-
if (staticLibrary && !podfile.includes('react-native-quick-sqlite')) {
27+
if (!podfile.includes('react-native-quick-sqlite')) {
2428
podfile = podfile.replace(/target\s+'[^']+'\s+do/, `$&\n${preinstallScript}`);
2529
fs.writeFileSync(podfilePath, podfile, 'utf8');
2630
console.log(`Added pre_install script for react-native-quick-sqlite to Podfile`);

0 commit comments

Comments
 (0)