(config: Config, name: string)
| 234 | } |
| 235 | |
| 236 | export async function requireCapacitorPackage(config: Config, name: string): Promise<PackageJson> { |
| 237 | const pkg = await getCapacitorPackage(config, name); |
| 238 | |
| 239 | if (!pkg) { |
| 240 | fatal( |
| 241 | `Unable to find node_modules/@capacitor/${name}.\n` + |
| 242 | `Are you sure ${c.strong(`@capacitor/${name}`)} is installed?`, |
| 243 | ); |
| 244 | } |
| 245 | return pkg; |
| 246 | } |
| 247 | |
| 248 | export async function getCapacitorPackageVersion(config: Config, platform: string): Promise<string> { |
| 249 | return (await requireCapacitorPackage(config, platform)).version; |
no test coverage detected