( plugins: Plugin[], platform: string, type: 'capacitor' | 'cordova' | 'incompatible' = 'capacitor', )
| 116 | } |
| 117 | |
| 118 | export function printPlugins( |
| 119 | plugins: Plugin[], |
| 120 | platform: string, |
| 121 | type: 'capacitor' | 'cordova' | 'incompatible' = 'capacitor', |
| 122 | ): void { |
| 123 | if (plugins.length === 0) { |
| 124 | return; |
| 125 | } |
| 126 | |
| 127 | let msg: string; |
| 128 | const plural = plugins.length === 1 ? '' : 's'; |
| 129 | |
| 130 | switch (type) { |
| 131 | case 'cordova': |
| 132 | msg = `Found ${plugins.length} Cordova plugin${plural} for ${c.strong(platform)}:\n`; |
| 133 | break; |
| 134 | case 'incompatible': |
| 135 | msg = `Found ${plugins.length} incompatible Cordova plugin${plural} for ${c.strong( |
| 136 | platform, |
| 137 | )}, skipped install:\n`; |
| 138 | break; |
| 139 | case 'capacitor': |
| 140 | msg = `Found ${plugins.length} Capacitor plugin${plural} for ${c.strong(platform)}:\n`; |
| 141 | break; |
| 142 | } |
| 143 | |
| 144 | msg += plugins.map((p) => `${p.id}${c.weak(`@${p.version}`)}`).join('\n'); |
| 145 | |
| 146 | logger.info(msg); |
| 147 | } |
| 148 | |
| 149 | export function getPluginPlatform(p: Plugin, platform: string): any { |
| 150 | const platforms = p.xml.platform; |
no test coverage detected