Skip to content

Commit

Permalink
fix(cli): prevent cordova dependency loop if plugin contains @ (#2622)
Browse files Browse the repository at this point in the history
  • Loading branch information
jcesarmobile authored Mar 23, 2020
1 parent e9bec42 commit 9dcb2ff
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions cli/src/cordova.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 9dcb2ff

Please sign in to comment.