// Copies the 1920x1080 verify screenshots into screenshots// and builds one contact sheet // PNG per theme (screenshots/contact-.png). Needs ImageMagick (montage). Run verify first. import { execFileSync } from 'node:child_process' import { cpSync, mkdirSync, readdirSync, rmSync } from 'node:fs' import { join } from 'node:path' const root = new URL('..', import.meta.url).pathname for (const theme of ['dark', 'light']) { const from = join(root, 'verify-shots', theme) const to = join(root, 'screenshots', theme) rmSync(to, { recursive: true, force: true }) mkdirSync(to, { recursive: true }) const files = readdirSync(from).filter((f) => f.endsWith('.png')).sort() for (const f of files) cpSync(join(from, f), join(to, f)) execFileSync('montage', [ ...files.map((f) => join(to, f)), '-tile', '4x', '-geometry', '640x360+10+10', '-background', theme === 'dark' ? '#05070a' : '#d9d2c5', join(root, 'screenshots', `contact-${theme}.png`), ]) console.log(`${theme}: ${files.length} slides, screenshots/contact-${theme}.png`) }