Skip to content

Commit 4b28b9a

Browse files
committed
Await async CLI command handlers
Await the inbox and nodeinfo handlers so the CLI does not exit before those commands finish and still reports failures through the process exit status. This also documents the shared runCli() helper now that it acts as the entrypoint for the Optique 1.0 runner setup. Assisted-by: Codex:gpt-5.4
1 parent 689d861 commit 4b28b9a

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

packages/cli/src/mod.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ async function main() {
1919
} else if (result.command === "webfinger") {
2020
await runWebFinger(result);
2121
} else if (result.command === "inbox") {
22-
runInbox(result);
22+
await runInbox(result);
2323
} else if (result.command === "nodeinfo") {
24-
runNodeInfo(result);
24+
await runNodeInfo(result);
2525
} else if (result.command === "tunnel") {
2626
await runTunnel(result);
2727
} else if (result.command === "generate-vocab") {

packages/cli/src/runner.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,11 @@ export function loadConfig(
119119
};
120120
}
121121

122+
/**
123+
* Runs the Fedify CLI with the given command-line arguments.
124+
* @param args Command-line arguments, usually `process.argv.slice(2)`.
125+
* @returns The parsed command result from Optique's runner.
126+
*/
122127
export function runCli(args: string[]) {
123128
return run(command, {
124129
contexts: [configContext],

0 commit comments

Comments
 (0)