@baeckerherz/expo-mapbox-navigation 0.1.11 → 0.1.12

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@baeckerherz/expo-mapbox-navigation",
3
- "version": "0.1.11",
3
+ "version": "0.1.12",
4
4
  "description": "Expo module wrapping Mapbox Navigation SDK v3 for iOS and Android",
5
5
  "main": "src/index.ts",
6
6
  "types": "src/index.ts",
@@ -104,10 +104,13 @@ const withMapboxNavPodfile = (config, { navigationSdkVersion }) => {
104
104
  end
105
105
  end`;
106
106
  const marker = "@baeckerherz/expo-mapbox-navigation: Mapbox SPM in Pods";
107
- if (!contents.includes(marker)) {
108
- if (contents.includes("post_install do |installer|")) {
109
- contents = contents.replace("post_install do |installer|", `post_install do |installer|${hook}`);
110
- }
107
+ const rnPostInstallSuffix = "ccache_enabled?(podfile_properties),\n )\n end";
108
+ const oldHookPattern = new RegExp(` # @baeckerherz/expo-mapbox-navigation: Mapbox SPM in Pods[\\s\\S]*?(?= react_native_post_install)`, "m");
109
+ if (contents.match(oldHookPattern)) {
110
+ contents = contents.replace(oldHookPattern, "");
111
+ }
112
+ if (!contents.includes(marker) && contents.includes(rnPostInstallSuffix)) {
113
+ contents = contents.replace(rnPostInstallSuffix, `ccache_enabled?(podfile_properties),\n )\n${hook}\n end`);
111
114
  }
112
115
  fs.writeFileSync(podfilePath, contents);
113
116
  return config;
@@ -84,13 +84,20 @@ export const withMapboxNavPodfile: ConfigPlugin<PodfileOptions> = (
84
84
  end`;
85
85
 
86
86
  const marker = "@baeckerherz/expo-mapbox-navigation: Mapbox SPM in Pods";
87
- if (!contents.includes(marker)) {
88
- if (contents.includes("post_install do |installer|")) {
89
- contents = contents.replace(
90
- "post_install do |installer|",
91
- `post_install do |installer|${hook}`
92
- );
93
- }
87
+ const rnPostInstallSuffix =
88
+ "ccache_enabled?(podfile_properties),\n )\n end";
89
+ const oldHookPattern = new RegExp(
90
+ ` # @baeckerherz/expo-mapbox-navigation: Mapbox SPM in Pods[\\s\\S]*?(?= react_native_post_install)`,
91
+ "m"
92
+ );
93
+ if (contents.match(oldHookPattern)) {
94
+ contents = contents.replace(oldHookPattern, "");
95
+ }
96
+ if (!contents.includes(marker) && contents.includes(rnPostInstallSuffix)) {
97
+ contents = contents.replace(
98
+ rnPostInstallSuffix,
99
+ `ccache_enabled?(podfile_properties),\n )\n${hook}\n end`
100
+ );
94
101
  }
95
102
 
96
103
  fs.writeFileSync(podfilePath, contents);