MCPcopy Index your code
hub / github.com/ionic-team/capacitor / checkPlatformVersions

Function checkPlatformVersions

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

Source from the content-addressed store, hash-verified

466}
467
468export async function checkPlatformVersions(config: Config, platform: string): Promise<void> {
469 const semver = await import('semver');
470 const coreVersion = await getCoreVersion(config);
471 const platformVersion = await getCapacitorPackageVersion(config, platform);
472
473 if (semver.diff(coreVersion, platformVersion) === 'minor' || semver.diff(coreVersion, platformVersion) === 'major') {
474 logger.warn(
475 `${c.strong('@capacitor/core')}${c.weak(
476 `@${coreVersion}`,
477 )} version doesn't match ${c.strong(`@capacitor/${platform}`)}${c.weak(`@${platformVersion}`)} version.\n` +
478 `Consider updating to a matching version, e.g. w/ ${c.input(`npm install @capacitor/core@${platformVersion}`)}`,
479 );
480 }
481}
482
483export function resolvePlatform(config: Config, platform: string): string | null {
484 if (platform[0] !== '@') {

Callers 2

updateAndroidFunction · 0.90
updateIOSFunction · 0.90

Calls 3

getCoreVersionFunction · 0.85
warnMethod · 0.80

Tested by

no test coverage detected