From 31ef0cdc7f9430d2bf66245baec73f86bd3344a5 Mon Sep 17 00:00:00 2001 From: knaito Date: Sat, 19 Jan 2019 17:34:24 +0900 Subject: [PATCH] support old cordova-common in which no getPodSpecs function --- bin/templates/scripts/cordova/Api.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/templates/scripts/cordova/Api.js b/bin/templates/scripts/cordova/Api.js index c59b573d3..bffcb7e65 100644 --- a/bin/templates/scripts/cordova/Api.js +++ b/bin/templates/scripts/cordova/Api.js @@ -267,7 +267,7 @@ Api.prototype.addPlugin = function (plugin, installOptions) { }) .then(function () { if (plugin != null) { - var podSpecs = plugin.getPodSpecs(self.platform); + var podSpecs = plugin.getPodSpecs ? plugin.getPodSpecs(self.platform) : []; var frameworkTags = plugin.getFrameworks(self.platform); var frameworkPods = frameworkTags.filter(function (obj) { return (obj.type === 'podspec'); @@ -321,7 +321,7 @@ Api.prototype.removePlugin = function (plugin, uninstallOptions) { }) .then(function () { if (plugin != null) { - var podSpecs = plugin.getPodSpecs(self.platform); + var podSpecs = plugin.getPodSpecs ? plugin.getPodSpecs(self.platform) : []; var frameworkTags = plugin.getFrameworks(self.platform); var frameworkPods = frameworkTags.filter(function (obj) { return (obj.type === 'podspec');