tangled
alpha
login
or
join now
dunkirk.sh
/
zera
5
fork
atom
the home site for me: also iteration 3 or 4 of my site
5
fork
atom
overview
issues
pulls
pipelines
bug: fix genog
dunkirk.sh
2 days ago
b5c58cd9
99bc5e8a
verified
This commit was signed with the committer's
known signature
.
dunkirk.sh
SSH Key Fingerprint:
SHA256:DqcG0RXYExE26KiWo3VxJnsxswN1QNfTBvB+bdSpk80=
+6
-6
1 changed file
expand all
collapse all
unified
split
scripts
genOG.ts
+6
-6
scripts/genOG.ts
···
1
1
import puppeteer from "puppeteer";
2
2
-
import { readdir, mkdir } from "node:fs/promises";
2
2
+
import { readdir, mkdir, access } from "node:fs/promises";
3
3
4
4
-
const template = await Bun.file("tools/og.html").text();
4
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
34
-
async function fileExists(path: string): Promise<boolean> {
34
34
+
async function pathExists(path: string): Promise<boolean> {
35
35
try {
36
36
-
await Bun.file(path);
36
36
+
await access(path);
37
37
return true;
38
38
-
} catch (e) {
38
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
48
-
if (!(await fileExists("public/"))) {
48
48
+
if (!(await pathExists("public/"))) {
49
49
console.error("public/ does not exist");
50
50
process.exit(1);
51
51
}