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

Function checkPackage

cli/src/common.ts:58–71  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

56}
57
58export async function checkPackage(): Promise<string | null> {
59 if (!(await pathExists('package.json'))) {
60 if (await pathExists('project.json')) {
61 return null;
62 } else {
63 return (
64 `The Capacitor CLI needs to run at the root of an npm package or in a valid NX monorepo.\n` +
65 `Make sure you have a package.json or project.json file in the directory where you run the Capacitor CLI.\n` +
66 `More info: ${c.strong('https://docs.npmjs.com/cli/init')}`
67 );
68 }
69 }
70 return null;
71}
72
73export async function checkCapacitorPlatform(config: Config, platform: string): Promise<string | null> {
74 const pkg = await getCapacitorPackage(config, platform);

Callers 3

updateCommandFunction · 0.90
addCommandFunction · 0.90
syncCommandFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected