From c059a162e4b518b345ef96afe474aa1a1cd0efd4 Mon Sep 17 00:00:00 2001 From: Martin Guillon Date: Wed, 2 Mar 2022 16:20:24 +0100 Subject: [PATCH 1/3] fix: prevent error with `pnpm` which can put `+` in plugin path --- lib/services/cocoapods-service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/services/cocoapods-service.ts b/lib/services/cocoapods-service.ts index 78b7c47eda..217ef1ecc7 100644 --- a/lib/services/cocoapods-service.ts +++ b/lib/services/cocoapods-service.ts @@ -281,7 +281,7 @@ end`.trim(); const regExpToRemove = new RegExp( `${this.getPluginPodfileHeader( podfilePath - )}[\\s\\S]*?${this.getPluginPodfileEnd()}`, + ).replaceAll("+", "\\+")}[\\s\\S]*?${this.getPluginPodfileEnd()}`, "mg" ); projectPodFileContent = projectPodFileContent.replace(regExpToRemove, ""); From 455ff6f160399f16717af13749987c6b2e5dfe3c Mon Sep 17 00:00:00 2001 From: Martin Guillon Date: Wed, 2 Mar 2022 17:10:41 +0100 Subject: [PATCH 2/3] chore: use replace instead --- lib/services/cocoapods-service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/services/cocoapods-service.ts b/lib/services/cocoapods-service.ts index 217ef1ecc7..ece1c43e61 100644 --- a/lib/services/cocoapods-service.ts +++ b/lib/services/cocoapods-service.ts @@ -281,7 +281,7 @@ end`.trim(); const regExpToRemove = new RegExp( `${this.getPluginPodfileHeader( podfilePath - ).replaceAll("+", "\\+")}[\\s\\S]*?${this.getPluginPodfileEnd()}`, + ).replace(/\+/g, "\\+")}[\\s\\S]*?${this.getPluginPodfileEnd()}`, "mg" ); projectPodFileContent = projectPodFileContent.replace(regExpToRemove, ""); From 05f4e9b143f2f41d5e7104fe16e279702333c4eb Mon Sep 17 00:00:00 2001 From: Igor Randjelovic Date: Mon, 7 Mar 2022 18:22:07 +0100 Subject: [PATCH 3/3] chore: cleanup --- lib/services/cocoapods-service.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/services/cocoapods-service.ts b/lib/services/cocoapods-service.ts index ece1c43e61..ca4211961b 100644 --- a/lib/services/cocoapods-service.ts +++ b/lib/services/cocoapods-service.ts @@ -281,7 +281,7 @@ end`.trim(); const regExpToRemove = new RegExp( `${this.getPluginPodfileHeader( podfilePath - ).replace(/\+/g, "\\+")}[\\s\\S]*?${this.getPluginPodfileEnd()}`, + )}[\\s\\S]*?${this.getPluginPodfileEnd()}`, "mg" ); projectPodFileContent = projectPodFileContent.replace(regExpToRemove, ""); @@ -479,6 +479,8 @@ end`.trim(); } private getPluginPodfileHeader(pluginPodFilePath: string): string { + // escape special + from the podfile path (pnpm) + pluginPodFilePath = pluginPodFilePath.replace(/\+/g, "\\+"); return `# Begin Podfile - ${pluginPodFilePath}`; }