( outputPath: string, elapsedMs: number, quiet: boolean, outputDurationSeconds?: number, frameCount?: number, )
| 1670 | } |
| 1671 | |
| 1672 | function printRenderComplete( |
| 1673 | outputPath: string, |
| 1674 | elapsedMs: number, |
| 1675 | quiet: boolean, |
| 1676 | outputDurationSeconds?: number, |
| 1677 | frameCount?: number, |
| 1678 | ): void { |
| 1679 | if (quiet) return; |
| 1680 | |
| 1681 | let fileSize = "unknown"; |
| 1682 | let isDirectory = false; |
| 1683 | try { |
| 1684 | const stat = statSync(outputPath); |
| 1685 | isDirectory = stat.isDirectory(); |
| 1686 | if (stat.isDirectory()) { |
| 1687 | // png-sequence output is a directory; sum the contained file sizes so |
| 1688 | // the user sees the on-disk footprint of the deliverable rather than |
| 1689 | // the platform-specific size of the directory inode itself. |
| 1690 | let total = 0; |
| 1691 | for (const entry of readdirSync(outputPath, { withFileTypes: true })) { |
| 1692 | if (!entry.isFile()) continue; |
| 1693 | try { |
| 1694 | total += statSync(join(outputPath, entry.name)).size; |
| 1695 | } catch { |
| 1696 | // skip unreadable entries |
| 1697 | } |
| 1698 | } |
| 1699 | fileSize = formatBytes(total); |
| 1700 | } else { |
| 1701 | fileSize = formatBytes(stat.size); |
| 1702 | } |
| 1703 | } catch { |
| 1704 | // file doesn't exist or is inaccessible |
| 1705 | } |
| 1706 | |
| 1707 | const detail = formatRenderSummaryDetail({ |
| 1708 | elapsedMs, |
| 1709 | outputDurationSeconds, |
| 1710 | isDirectory, |
| 1711 | frameCount, |
| 1712 | }); |
| 1713 | console.log(""); |
| 1714 | console.log(c.success("\u25C7") + " " + c.accent(outputPath)); |
| 1715 | console.log(" " + c.bold(fileSize) + c.dim(" \u00B7 " + detail)); |
| 1716 | } |
no test coverage detected