/ proof-of-concept / steelsim21
Sign in
proof-of-concept / steelsim21
gallery --html-only: regenerate the page without simulating
Jeremy Magland <jmagland@flatironinstitute.org> committed commit ea89863633f3 parent 074cb4e Browse files
1 changed file+7−2
src/cli/main.tsmodified+7−2View file
@@ -1,7 +1,7 @@
11 // Command-line renderer.
22 //
33 // steelsim render [--out DIR] [--name ID] [--gain DB] key=value ...
4-// steelsim gallery MANIFEST.json [--out DIR] [--only SWEEP_ID] [--force] [key=value ...]
4+// steelsim gallery MANIFEST.json [--out DIR] [--only SWEEP_ID] [--force] [--html-only] [key=value ...]
55 //
66 // Common options: --engine chrome|dawn (default chrome), --chrome PATH (Chrome
77 // executable; Playwright's Chromium when omitted), --dist DIR (built app).
@@ -27,7 +27,7 @@ for (let i = 0; i < args.length; i++) {
2727 const a = args[i];
2828 if (a.startsWith("--")) {
2929 const key = a.slice(2);
30- if (key === "force") opts[key] = "1";
30+ if (key === "force" || key === "html-only") opts[key] = "1";
3131 else if (key === "chrome" && (i + 1 >= args.length || args[i + 1].startsWith("--"))) opts[key] = "";
3232 else opts[key] = args[++i];
3333 } else if (a.includes("=")) {
@@ -141,6 +141,11 @@ async function gallery(): Promise<void> {
141141 mkdirSync(clipsDir, { recursive: true });
142142 mkdirSync(rawDir, { recursive: true });
143143 const only = opts.only;
144+ if (opts["html-only"]) {
145+ writeHtml(manifest, dir);
146+ console.log("index.html regenerated from the existing sweep files");
147+ return;
148+ }
144149 for (const sw of manifest.sweeps) {
145150 if (only && sw.id !== only) continue;
146151 console.log(`== ${sw.id}: ${sw.title}`);
↑↓ move↵openescclose