\($commit)
"])),
+ }
+ ' > "$tmp"
+ find result -name '*.html' -exec \
+ node scripts/insert_warning.mjs --strict scripts/pr_preview_warning.html "$tmp" '{}' '+'
- name: Publish to gh-pages
uses: JamesIves/github-pages-deploy-action@v4.3.3
with:
diff --git a/package.json b/package.json
index abb4689..98ccf43 100644
--- a/package.json
+++ b/package.json
@@ -17,7 +17,8 @@
"license": "MIT",
"devDependencies": {
"@tc39/ecma262-biblio": "^2.1.2775",
- "ecmarkup": "^20.0.0"
+ "ecmarkup": "^20.0.0",
+ "jsdom": "^25.0.1"
},
"engines": {
"node": ">= 12"
diff --git a/scripts/insert_warning.mjs b/scripts/insert_warning.mjs
new file mode 100644
index 0000000..6c6fc7c
--- /dev/null
+++ b/scripts/insert_warning.mjs
@@ -0,0 +1,73 @@
+import fs from 'node:fs';
+import pathlib from 'node:path';
+import { parseArgs } from 'node:util';
+import { JSDOM, VirtualConsole } from 'jsdom';
+
+const { positionals: cliArgs, values: cliOpts } = parseArgs({
+ allowPositionals: true,
+ options: {
+ strict: { type: 'boolean' },
+ },
+});
+if (cliArgs.length < 3) {
+ const self = pathlib.relative(process.cwd(), process.argv[1]);
+ console.error(`Usage: node ${self} [--strict]