|
1 | 1 | // fallow-ignore-file code-duplication |
2 | | -import { failCommand } from "../utils/commandResult.js"; |
| 2 | +import { failCommand, failUsage } from "../utils/commandResult.js"; |
3 | 3 | /** |
4 | 4 | * `hyperframes cloudrun` — deploy + drive distributed renders on Google |
5 | 5 | * Cloud Run + Cloud Workflows. |
@@ -327,7 +327,7 @@ async function runDeploy(args: Record<string, unknown>): Promise<void> { |
327 | 327 | const project = args.project as string | undefined; |
328 | 328 | if (!project) { |
329 | 329 | console.error("[cloudrun deploy] --project <gcp-project-id> is required."); |
330 | | - failCommand(); |
| 330 | + failUsage(); |
331 | 331 | } |
332 | 332 | const region = (args.region as string | undefined) ?? "us-central1"; |
333 | 333 | const repo = (args.repo as string | undefined) ?? "hyperframes"; |
@@ -355,7 +355,7 @@ async function runDeploy(args: Record<string, unknown>): Promise<void> { |
355 | 355 | console.error( |
356 | 356 | "[cloudrun deploy] --image is required when not running from a hyperframes checkout (no Dockerfile context found).", |
357 | 357 | ); |
358 | | - failCommand(); |
| 358 | + failUsage(); |
359 | 359 | } |
360 | 360 | // Ensure the Artifact Registry repo exists. |
361 | 361 | const exists = |
@@ -497,7 +497,7 @@ async function runSites(args: Record<string, unknown>): Promise<void> { |
497 | 497 | const projectDir = args.extra as string | undefined; |
498 | 498 | if (!projectDir) { |
499 | 499 | console.error("[cloudrun sites create] usage: hyperframes cloudrun sites create <projectDir>"); |
500 | | - failCommand(); |
| 500 | + failUsage(); |
501 | 501 | } |
502 | 502 | const state = readState(args); |
503 | 503 | const { deploySite } = await loadCloudRunAdapter(); |
@@ -538,7 +538,7 @@ async function runRender(args: Record<string, unknown>): Promise<void> { |
538 | 538 | console.error( |
539 | 539 | "[cloudrun render] usage: hyperframes cloudrun render <projectDir> --width <px> --height <px>", |
540 | 540 | ); |
541 | | - failCommand(); |
| 541 | + failUsage(); |
542 | 542 | } |
543 | 543 | const width = parsePositiveInt(args.width, "--width"); |
544 | 544 | const height = parsePositiveInt(args.height, "--height"); |
@@ -604,7 +604,7 @@ async function runProgress(args: Record<string, unknown>): Promise<void> { |
604 | 604 | const executionName = args.target as string | undefined; |
605 | 605 | if (!executionName) { |
606 | 606 | console.error("[cloudrun progress] usage: hyperframes cloudrun progress <executionName>"); |
607 | | - failCommand(); |
| 607 | + failUsage(); |
608 | 608 | } |
609 | 609 | const { getRenderProgress } = await loadCloudRunAdapter(); |
610 | 610 | const progress = await getRenderProgress({ executionName }); |
@@ -644,7 +644,7 @@ async function runRenderBatch(args: Record<string, unknown>): Promise<void> { |
644 | 644 | console.error( |
645 | 645 | "[cloudrun render-batch] usage: hyperframes cloudrun render-batch <projectDir> --batch <file.jsonl> --width <px> --height <px>", |
646 | 646 | ); |
647 | | - failCommand(); |
| 647 | + failUsage(); |
648 | 648 | } |
649 | 649 | const width = parsePositiveInt(args.width, "--width"); |
650 | 650 | const height = parsePositiveInt(args.height, "--height"); |
@@ -774,7 +774,7 @@ async function runDestroy(args: Record<string, unknown>): Promise<void> { |
774 | 774 | const image = (args.image as string | undefined) ?? "unused:latest"; |
775 | 775 | if (!project) { |
776 | 776 | console.error("[cloudrun destroy] --project is required (or deploy first to cache it)."); |
777 | | - failCommand(); |
| 777 | + failUsage(); |
778 | 778 | } |
779 | 779 | const vars = [ |
780 | 780 | "-var", |
|
0 commit comments