22 lines
683 B
JavaScript
22 lines
683 B
JavaScript
const { withPodfile } = require("@expo/config-plugins");
|
|
|
|
const marker = "# MapLibreParticleRNTestHost Particle iOS SPM hook";
|
|
|
|
module.exports = function withParticleNativeIos(config) {
|
|
return withPodfile(config, (project) => {
|
|
const contents = project.modResults.contents;
|
|
if (contents.includes(marker)) return project;
|
|
|
|
const needle = " post_install do |installer|";
|
|
if (!contents.includes(needle)) {
|
|
throw new Error("Expo post_install block was not generated.");
|
|
}
|
|
|
|
project.modResults.contents = contents.replace(
|
|
needle,
|
|
needle + "\n " + marker + "\n $MLRN_PARTICLE.post_install(installer)",
|
|
);
|
|
return project;
|
|
});
|
|
};
|