the home site for me: also iteration 3 or 4 of my site

bug: fix genog

dunkirk.sh b5c58cd9 99bc5e8a

verified
+6 -6
+6 -6
scripts/genOG.ts
··· 1 1 import puppeteer from "puppeteer"; 2 - import { readdir, mkdir } from "node:fs/promises"; 2 + import { readdir, mkdir, access } from "node:fs/promises"; 3 3 4 - const template = await Bun.file("tools/og.html").text(); 4 + const template = await Bun.file("scripts/og.html").text(); 5 5 6 6 const browser = await puppeteer.launch({ 7 7 args: ["--no-sandbox"], ··· 31 31 await page.screenshot({ path: outputPath }); 32 32 } 33 33 34 - async function fileExists(path: string): Promise<boolean> { 34 + async function pathExists(path: string): Promise<boolean> { 35 35 try { 36 - await Bun.file(path); 36 + await access(path); 37 37 return true; 38 - } catch (e) { 38 + } catch { 39 39 return false; 40 40 } 41 41 } ··· 45 45 // if not exit 46 46 // if it does, get all the folders and then get the title tag from the index.html 47 47 48 - if (!(await fileExists("public/"))) { 48 + if (!(await pathExists("public/"))) { 49 49 console.error("public/ does not exist"); 50 50 process.exit(1); 51 51 }