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

Function generatePackageFile

cli/src/util/spm.ts:41–51  ·  view source on GitHub ↗
(config: Config, plugins: Plugin[])

Source from the content-addressed store, hash-verified

39}
40
41export async function generatePackageFile(config: Config, plugins: Plugin[]): Promise<void> {
42 const packageSwiftFile = await findPackageSwiftFile(config);
43 try {
44 logger.info('Writing Package.swift');
45
46 const textToWrite = await generatePackageText(config, plugins);
47 writeFileSync(packageSwiftFile, textToWrite);
48 } catch (err) {
49 logger.error(`Unable to write to ${packageSwiftFile}. Verify it is not already open. \n Error: ${err}`);
50 }
51}
52
53export async function checkPluginsForPackageSwift(config: Config, plugins: Plugin[]): Promise<Plugin[]> {
54 const iOSCapacitorPlugins = plugins.filter((p) => getPluginType(p, 'ios') === PluginType.Core);

Callers 1

updatePluginFilesFunction · 0.90

Calls 4

findPackageSwiftFileFunction · 0.85
generatePackageTextFunction · 0.85
infoMethod · 0.80
errorMethod · 0.80

Tested by

no test coverage detected