From 989ffd54ce9ec5314776c9bd6405f0c690da70fc Mon Sep 17 00:00:00 2001 From: Christopher Monsanto Date: Mon, 17 Aug 2026 15:52:57 -0400 Subject: [PATCH] Make bare deploy list the configured deploys Deploying is opt-in per name; with no names the verb prints each deploy's buildFile and (subset, cmd) entries instead of shipping everything. Co-Authored-By: Claude Fable 5 --- README.md | 4 ++-- tools/deploy/index.ts | 19 ++++++++++++++----- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 8c25e06b..1348bae5 100644 --- a/README.md +++ b/README.md @@ -62,8 +62,8 @@ reuses the build's digests. All state lives in `.build/`. ``` $ pnpm build # build every deploy's rules, GC stale state -$ pnpm deploy # every deploy in deploy.json5 -$ node tools/deploy/index.ts deploy assets # one named deploy +$ pnpm deploy # list the deploys in deploy.json5 +$ pnpm deploy assets # run a named deploy $ node tools/deploy/index.ts build ps.build.ts # build one deploy's rules $ node tools/deploy/index.ts run smogon.build.ts -o deploy/smogon $ node tools/deploy/index.ts inspect src/minisprites/items/i1.png -o /tmp/out diff --git a/tools/deploy/index.ts b/tools/deploy/index.ts index 7188525e..1ffd6c5c 100644 --- a/tools/deploy/index.ts +++ b/tools/deploy/index.ts @@ -175,20 +175,29 @@ common(program.command('build [files...]')) }); common(program.command('deploy [names...]')) - .description('build, finish, and pipe each subset tar to its command from deploy.json5') + .description('build, finish, and pipe each subset tar to its command from deploy.json5' + + ' (no names: list the available deploys)') .action(async (names : string[], opts : CommonOpts) => { const config = loadDeployConfig('deploy.json5'); - const targets = names.length > 0 ? names : [...config.keys()]; - for (const name of targets) { + if (names.length === 0) { + for (const [name, target] of config) { + console.log(`${name} (${target.buildFile})`); + for (const entry of target.deploy) { + console.log(` ${entry.subset.join(' ')} | ${entry.cmd}`); + } + } + return; + } + for (const name of names) { if (!config.has(name)) { throw new BuildError(`deploy.json5: no deploy named ${name}`); } } setConfig(loadConfig(opts.config)); - const files = [...new Set(targets.map(n => config.get(n)!.buildFile))]; + const files = [...new Set(names.map(n => config.get(n)!.buildFile))]; const specs = await importDeploys(files); process.exitCode = await buildThen(getDecls(), opts, false, async () => { - for (const name of targets) { + for (const name of names) { const target = config.get(name)!; const aq = await runFinish(finishOf(specs, target.buildFile), Boolean(opts.verbose)); if (aq === null) {