MCPcopy Create free account
hub / github.com/heygen-com/hyperframes / runSites

Function runSites

packages/cli/src/commands/cloudrun.ts:456–483  ·  view source on GitHub ↗
(args: Record<string, unknown>)

Source from the content-addressed store, hash-verified

454
455// fallow-ignore-next-line complexity
456async function runSites(args: Record<string, unknown>): Promise<void> {
457 if (args.target !== "create") {
458 console.error(
459 `[cloudrun sites] unknown verb "${String(args.target)}". Only "create" is supported.`,
460 );
461 process.exit(1);
462 }
463 const projectDir = args.extra as string | undefined;
464 if (!projectDir) {
465 console.error("[cloudrun sites create] usage: hyperframes cloudrun sites create <projectDir>");
466 process.exit(1);
467 }
468 const state = readState(args);
469 const { deploySite } = await import("@hyperframes/gcp-cloud-run/sdk");
470 const handle = await deploySite({
471 projectDir: resolve(projectDir),
472 bucketName: state.bucketName,
473 siteId: args["site-id"] as string | undefined,
474 });
475 if (args.json) {
476 console.log(JSON.stringify(handle, null, 2));
477 } else {
478 console.log(
479 `${handle.uploaded ? c.accent("✓ uploaded") : c.dim("• already present")} ` +
480 `site=${handle.siteId} (${handle.bytes} bytes)\n ${handle.projectGcsUri}`,
481 );
482 }
483}
484
485// ── render ──────────────────────────────────────────────────────────────────
486

Callers 1

runFunction · 0.85

Calls 4

readStateFunction · 0.85
resolveFunction · 0.85
errorMethod · 0.80
deploySiteFunction · 0.50

Tested by

no test coverage detected