From 927c644d53eb434e362de5c986fef58d7c3ed5a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julio=20C=C3=A9sar?= Date: Tue, 23 Jan 2018 16:36:47 +0100 Subject: [PATCH] Make plugins pods paths relative --- cli/src/ios/common.ts | 6 +++--- cli/src/ios/update.ts | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cli/src/ios/common.ts b/cli/src/ios/common.ts index 3c777baef4..a6c55e1605 100644 --- a/cli/src/ios/common.ts +++ b/cli/src/ios/common.ts @@ -46,9 +46,9 @@ export async function resolvePlugin(plugin: Plugin): Promise { if (!plugin.manifest.ios.src) { throw 'capacitor.ios.src is missing'; } - iosPath = join(plugin.rootPath, plugin.manifest.ios.src); + iosPath = plugin.manifest.ios.src; } else if (plugin.xml) { - iosPath = join(plugin.rootPath, "src/ios"); + iosPath = "src/ios"; } else { return null; } @@ -58,7 +58,7 @@ export async function resolvePlugin(plugin: Plugin): Promise { type: PluginType.Code, path: iosPath }; - const files = await readdirAsync(iosPath); + const files = await readdirAsync(join(plugin.rootPath, iosPath)); const podSpec = files.find(file => file.endsWith('.podspec')); if (podSpec) { plugin.ios.type = PluginType.Cocoapods; diff --git a/cli/src/ios/update.ts b/cli/src/ios/update.ts index 41a0df09b8..72715e3db6 100644 --- a/cli/src/ios/update.ts +++ b/cli/src/ios/update.ts @@ -68,7 +68,7 @@ export async function autoGeneratePods(plugins: Plugin[]): Promise { const name = p.ios!.name = p.name; p.ios!.type = PluginType.Cocoapods; const content = generatePodspec(name); - const path = join(p.ios!.path, name + '.podspec'); + const path = join(p.rootPath, p.ios!.path, name + '.podspec'); return writeFileAsync(path, content); })); } @@ -118,7 +118,7 @@ export async function updatePodfile(config: Config, plugins: Plugin[], needsUpda export function generatePodFile(config: Config, plugins: Plugin[]) { const pods = plugins - .map((p) => `pod '${p.ios!.name}', :path => '${p.ios!.path}'`); + .map((p) => `pod '${p.ios!.name}', :path => '../../node_modules/${p.id}/${p.ios!.path}'`); return ` # DO NOT MODIFY.