( s3: S3Client, result: ChunkResult, prefix: string, chunkIndex: number, )
| 365 | } |
| 366 | |
| 367 | async function uploadChunkOutput( |
| 368 | s3: S3Client, |
| 369 | result: ChunkResult, |
| 370 | prefix: string, |
| 371 | chunkIndex: number, |
| 372 | ): Promise<string> { |
| 373 | const trimmed = trimTrailingSlash(prefix); |
| 374 | if (result.outputKind === "file") { |
| 375 | const ext = result.outputPath.slice(result.outputPath.lastIndexOf(".")); |
| 376 | const uri = `${trimmed}/chunks/${pad(chunkIndex)}${ext}`; |
| 377 | await uploadFileToS3(s3, result.outputPath, uri); |
| 378 | return uri; |
| 379 | } |
| 380 | // frame-dir: upload as a tarball so a single S3 object represents the chunk. |
| 381 | // Assemble's png-sequence path expects a directory per chunk; it untars on |
| 382 | // its end. |
| 383 | const tarball = `${result.outputPath}.tar.gz`; |
| 384 | await tarDirectory(result.outputPath, tarball); |
| 385 | const uri = `${trimmed}/chunks/${pad(chunkIndex)}.tar.gz`; |
| 386 | await uploadFileToS3(s3, tarball, uri, "application/gzip"); |
| 387 | return uri; |
| 388 | } |
| 389 | |
| 390 | // ── Assemble ──────────────────────────────────────────────────────────────── |
| 391 |
no test coverage detected