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

Function getPluginFiles

cli/src/util/iosplugin.ts:12–34  ·  view source on GitHub ↗
(plugins: Plugin[])

Source from the content-addressed store, hash-verified

10import { readdirp } from './fs';
11
12export async function getPluginFiles(plugins: Plugin[]): Promise<string[]> {
13 let filenameList: string[] = [];
14
15 const options: ReaddirPOptions = {
16 filter: (item) => {
17 if (item.stats.isFile() && (item.path.endsWith('.swift') || item.path.endsWith('.m'))) {
18 return true;
19 } else {
20 return false;
21 }
22 },
23 };
24
25 for (const plugin of plugins) {
26 if (plugin.ios && getPluginType(plugin, 'ios') === PluginType.Core) {
27 const pluginPath = resolve(plugin.rootPath, plugin.ios?.path);
28 const filenames = await readdirp(pluginPath, options);
29 filenameList = filenameList.concat(filenames);
30 }
31 }
32
33 return filenameList;
34}
35
36export async function findPluginClasses(files: string[]): Promise<string[]> {
37 const classList: string[] = [];

Callers 1

generateIOSPackageJSONFunction · 0.85

Calls 2

getPluginTypeFunction · 0.90
readdirpFunction · 0.90

Tested by

no test coverage detected