(title: string, fn: () => Promise<T>)
| 210 | } |
| 211 | |
| 212 | export async function runTask<T>(title: string, fn: () => Promise<T>): Promise<T> { |
| 213 | const chain = output.createTaskChain(); |
| 214 | chain.next(title); |
| 215 | |
| 216 | try { |
| 217 | const value = await fn(); |
| 218 | chain.end(); |
| 219 | return value; |
| 220 | } catch (e) { |
| 221 | chain.fail(); |
| 222 | throw e; |
| 223 | } |
| 224 | } |
| 225 | |
| 226 | export async function getCapacitorPackage(config: Config, name: string): Promise<PackageJson | null> { |
| 227 | const packagePath = resolveNode(config.app.rootDir, `@capacitor/${name}`, 'package.json'); |
no outgoing calls
no test coverage detected