Publish multi-version documentation site (#1727)
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: bb4b44f0-f505-49c5-9878-76e2b40c7a15 Copilot-Session: 8eac1204-10ae-4319-9333-aee5dd43dcc8
This commit is contained in:
parent
a5179df39b
commit
ae36026695
1 changed files with 819 additions and 134 deletions
17
scripts/list-versions.mjs
Normal file
17
scripts/list-versions.mjs
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
// Print the versions to build, one per line, as "<slug>\t<ref>".
|
||||
// Consumed by the multi-version docs workflow to drive its build loop.
|
||||
//
|
||||
// Usage: node scripts/list-versions.mjs [--versions <path>]
|
||||
|
||||
import { readFile } from "node:fs/promises";
|
||||
import path from "node:path";
|
||||
import { manifestPath } from "./manifest-path.mjs";
|
||||
|
||||
const arg = process.argv.slice(2);
|
||||
const i = arg.indexOf("--versions");
|
||||
const versionsPath = i !== -1 ? path.resolve(arg[i + 1]) : manifestPath;
|
||||
|
||||
const manifest = JSON.parse(await readFile(versionsPath, "utf8"));
|
||||
for (const v of manifest.versions) {
|
||||
process.stdout.write(`${v.slug}\t${v.ref}\n`);
|
||||
}
|
||||
Loading…
Reference in a new issue