fix(cli): precompute bare root help startup path

This commit is contained in:
Vincent Koc
2026-03-24 12:23:25 -07:00
parent 91b1e41132
commit 805bff6e7e
3 changed files with 72 additions and 8 deletions

View File

@@ -1,6 +1,7 @@
import { mkdirSync, readdirSync, readFileSync, writeFileSync } from "node:fs";
import path from "node:path";
import { fileURLToPath } from "node:url";
import { renderRootHelpText } from "../src/cli/program/root-help.ts";
function dedupe(values: string[]): string[] {
const seen = new Set<string>();
@@ -77,6 +78,7 @@ function readBundledChannelCatalogIds(): string[] {
const catalog = readBundledChannelCatalogIds();
const channelOptions = dedupe([...CORE_CHANNEL_ORDER, ...catalog]);
const rootHelpText = renderRootHelpText();
mkdirSync(distDir, { recursive: true });
writeFileSync(
@@ -85,6 +87,7 @@ writeFileSync(
{
generatedBy: "scripts/write-cli-startup-metadata.ts",
channelOptions,
rootHelpText,
},
null,
2,