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

Function getFilePath

cli/src/plugin.ts:196–211  ·  view source on GitHub ↗
(config: Config, plugin: Plugin, path: string)

Source from the content-addressed store, hash-verified

194}
195
196export function getFilePath(config: Config, plugin: Plugin, path: string): string {
197 if (path.startsWith('node_modules')) {
198 let pathSegments = path.split('/').slice(1);
199 if (pathSegments[0].startsWith('@')) {
200 pathSegments = [pathSegments[0] + '/' + pathSegments[1], ...pathSegments.slice(2)];
201 }
202
203 const filePath = resolveNode(config.app.rootDir, ...pathSegments);
204 if (!filePath) {
205 throw new Error(`Can't resolve module ${pathSegments[0]}`);
206 }
207
208 return filePath;
209 }
210 return join(plugin.rootPath, path);
211}
212
213/**
214 * For a given plugin, return all the plugin.xml elements with elementName, checking root and specified platform

Callers 2

copyPluginsNativeFilesFunction · 0.90
copyPluginsNativeFilesFunction · 0.90

Calls 1

resolveNodeFunction · 0.90

Tested by

no test coverage detected