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

Function resolvePlatform

cli/src/common.ts:483–512  ·  view source on GitHub ↗
(config: Config, platform: string)

Source from the content-addressed store, hash-verified

481}
482
483export function resolvePlatform(config: Config, platform: string): string | null {
484 if (platform[0] !== '@') {
485 const core = resolveNode(config.app.rootDir, `@capacitor/${platform}`, 'package.json');
486
487 if (core) {
488 return dirname(core);
489 }
490
491 const community = resolveNode(config.app.rootDir, `@capacitor-community/${platform}`, 'package.json');
492
493 if (community) {
494 return dirname(community);
495 }
496
497 const enterprise = resolveNode(config.app.rootDir, `@ionic-enterprise/capacitor-${platform}`, 'package.json');
498
499 if (enterprise) {
500 return dirname(enterprise);
501 }
502 }
503
504 // third-party
505 const thirdParty = resolveNode(config.app.rootDir, platform, 'package.json');
506
507 if (thirdParty) {
508 return dirname(thirdParty);
509 }
510
511 return null;
512}
513
514export async function checkJDKMajorVersion(): Promise<number> {
515 try {

Callers 5

copyCommandFunction · 0.90
updateCommandFunction · 0.90
runCommandFunction · 0.90
addCommandFunction · 0.90
openCommandFunction · 0.90

Calls 1

resolveNodeFunction · 0.90

Tested by

no test coverage detected