()
| 71 | const videoPath = "./video.ogv"; |
| 72 | |
| 73 | async function downloadVideo() { |
| 74 | logger.log("downloading video", { url: videoUrl }); |
| 75 | |
| 76 | const response = await fetch(videoUrl); |
| 77 | |
| 78 | if (!response.body) { |
| 79 | throw new Error("No readable stream"); |
| 80 | } |
| 81 | |
| 82 | const readStream = Readable.fromWeb(response.body as ReadableStream); |
| 83 | await writeFile(videoPath, readStream); |
| 84 | |
| 85 | logger.log("finished downloading", { outputPath: videoPath }); |
| 86 | } |
| 87 | |
| 88 | async function execute(file: string, args?: readonly string[]) { |
| 89 | const { execa } = await import("execa"); |
no test coverage detected
searching dependent graphs…