MCPcopy
hub / github.com/ionic-team/capacitor / printPlugins

Function printPlugins

cli/src/plugin.ts:118–147  ·  view source on GitHub ↗
(
  plugins: Plugin[],
  platform: string,
  type: 'capacitor' | 'cordova' | 'incompatible' = 'capacitor',
)

Source from the content-addressed store, hash-verified

116}
117
118export 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
149export function getPluginPlatform(p: Plugin, platform: string): any {
150 const platforms = p.xml.platform;

Callers 5

handleCordovaPluginsJSFunction · 0.90
updateAndroidFunction · 0.90
updateIOSFunction · 0.90
updatePluginFilesFunction · 0.90
listFunction · 0.90

Calls 1

infoMethod · 0.80

Tested by

no test coverage detected