(params: {
archivePath: string;
tempDir: string;
platform: 'ios' | 'android';
expectedRootName?: string;
})
| 4 | import { runCmd } from '../utils/exec.ts'; |
| 5 | |
| 6 | export async function extractTarInstallableArtifact(params: { |
| 7 | archivePath: string; |
| 8 | tempDir: string; |
| 9 | platform: 'ios' | 'android'; |
| 10 | expectedRootName?: string; |
| 11 | }): Promise<string> { |
| 12 | const rootName = await resolveTarArchiveRootName(params); |
| 13 | await runCmd('tar', ['xf', params.archivePath, '-C', params.tempDir]); |
| 14 | const installablePath = path.join(params.tempDir, rootName); |
| 15 | if (!fs.existsSync(installablePath)) { |
| 16 | throw new AppError( |
| 17 | 'INVALID_ARGS', |
| 18 | `Expected extracted bundle "${rootName}" not found in archive`, |
| 19 | ); |
| 20 | } |
| 21 | return installablePath; |
| 22 | } |
| 23 | |
| 24 | export async function resolveTarArchiveRootName(params: { |
| 25 | archivePath: string; |
no test coverage detected
searching dependent graphs…