From 9dcb2ff32ffd954e263e4a40d84693a828872645 Mon Sep 17 00:00:00 2001 From: jcesarmobile Date: Mon, 23 Mar 2020 20:20:47 +0100 Subject: [PATCH] fix(cli): prevent cordova dependency loop if plugin contains @ (#2622) --- cli/src/cordova.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cli/src/cordova.ts b/cli/src/cordova.ts index 93418c444b..4a50cdc5c7 100644 --- a/cli/src/cordova.ts +++ b/cli/src/cordova.ts @@ -304,8 +304,11 @@ export async function checkAndInstallDependencies(config: Config, plugins: Plugi allDependencies = allDependencies.filter((dep: any) => !getIncompatibleCordovaPlugins(platform).includes(dep.$.id) && incompatible.filter(p => p.id === dep.$.id || p.xml.$.id === dep.$.id).length === 0); if (allDependencies) { await Promise.all(allDependencies.map(async (dep: any) => { - if (cordovaPlugins.filter(p => p.id === dep.$.id || p.xml.$.id === dep.$.id).length === 0) { - let plugin = dep.$.id; + let plugin = dep.$.id; + if (plugin.includes('@')) { + plugin = plugin.split('@')[0]; + } + if (cordovaPlugins.filter(p => p.id === plugin || p.xml.$.id === plugin).length === 0) { if (dep.$.url && dep.$.url.startsWith('http')) { plugin = dep.$.url; }