(config: Config, selectedPlatformName: string, inline = false)
| 23 | import { inlineSourceMaps } from './sourcemaps'; |
| 24 | |
| 25 | export async function copyCommand(config: Config, selectedPlatformName: string, inline = false): Promise<void> { |
| 26 | if (selectedPlatformName && !(await isValidPlatform(selectedPlatformName))) { |
| 27 | const platformDir = resolvePlatform(config, selectedPlatformName); |
| 28 | if (platformDir) { |
| 29 | await runPlatformHook(config, selectedPlatformName, platformDir, 'capacitor:copy'); |
| 30 | } else { |
| 31 | logger.error(`Platform ${c.input(selectedPlatformName)} not found.`); |
| 32 | } |
| 33 | } else { |
| 34 | const platforms = await selectPlatforms(config, selectedPlatformName); |
| 35 | try { |
| 36 | await allSerial(platforms.map((platformName) => () => copy(config, platformName, inline))); |
| 37 | } catch (e: any) { |
| 38 | if (isFatal(e)) { |
| 39 | throw e; |
| 40 | } |
| 41 | |
| 42 | logger.error(e.stack ?? e); |
| 43 | } |
| 44 | } |
| 45 | } |
| 46 | |
| 47 | export async function copy(config: Config, platformName: string, inline = false): Promise<void> { |
| 48 | await runTask(c.success(c.strong(`copy ${platformName}`)), async () => { |
no test coverage detected