MCPcopy Create free account
hub / github.com/callstack/agent-device / extractTarInstallableArtifact

Function extractTarInstallableArtifact

src/daemon/artifact-archive.ts:6–22  ·  view source on GitHub ↗
(params: {
  archivePath: string;
  tempDir: string;
  platform: 'ios' | 'android';
  expectedRootName?: string;
})

Source from the content-addressed store, hash-verified

4import { runCmd } from '../utils/exec.ts';
5
6export 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
24export async function resolveTarArchiveRootName(params: {
25 archivePath: string;

Callers 3

resolveIosArtifactFunction · 0.90
receiveUploadFunction · 0.90
finalizeResumableUploadFunction · 0.90

Calls 2

runCmdFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…