From c38cca150b02ade68f8b81362e2ec495ce628fc3 Mon Sep 17 00:00:00 2001 From: Eddy Verbruggen Date: Tue, 25 Sep 2018 21:19:56 +0200 Subject: [PATCH 1/2] Having two plugins with Podfiles and a postinstallhook fails With NativeScript 5.0.0-2018-09-25-12302 having nativescript-plugin-firebase and nativescript-imagepicker in your project will fail because there's some whitespace missing. --- 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 b52dabaf6d..468382d7cd 100644 --- a/lib/services/cocoapods-service.ts +++ b/lib/services/cocoapods-service.ts @@ -90,7 +90,7 @@ export class CocoaPodsService implements ICocoaPodsService { finalPodfileContent = finalPodfileContent.replace(postInstallHookStart, `${postInstallHookStart}${postInstallHookContent}`); } else { const postInstallHook = `${postInstallHookStart}${postInstallHookContent}end`; - finalPodfileContent = `${finalPodfileContent}${postInstallHook}`; + finalPodfileContent = `${finalPodfileContent}${EOL}${EOL}${postInstallHook}`; } } From 1acc45ed8e772c09a1e0e9868b278cf12d95be64 Mon Sep 17 00:00:00 2001 From: EddyVerbruggen Date: Wed, 26 Sep 2018 13:10:19 +0200 Subject: [PATCH 2/2] Better fix - not adding linebreaks when not needed --- lib/services/cocoapods-service.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/services/cocoapods-service.ts b/lib/services/cocoapods-service.ts index 468382d7cd..9afedc6aab 100644 --- a/lib/services/cocoapods-service.ts +++ b/lib/services/cocoapods-service.ts @@ -89,8 +89,11 @@ export class CocoaPodsService implements ICocoaPodsService { if (index !== -1) { finalPodfileContent = finalPodfileContent.replace(postInstallHookStart, `${postInstallHookStart}${postInstallHookContent}`); } else { + if (finalPodfileContent.length > 0) { + finalPodfileContent += `${EOL}${EOL}`; + } const postInstallHook = `${postInstallHookStart}${postInstallHookContent}end`; - finalPodfileContent = `${finalPodfileContent}${EOL}${EOL}${postInstallHook}`; + finalPodfileContent = `${finalPodfileContent}${postInstallHook}`; } }