Skip to content

Commit a28478f

Browse files
committed
fix(marketing): satisfy typecheck in the screenshot environment script
1 parent 5f4a728 commit a28478f

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

‎scripts/marketing-screenshot-environment.ts‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,9 @@ export async function seedMarketingEnvironment(baseDir: string): Promise<string>
546546
title: project.title,
547547
repositoryUrl: project.repositoryUrl,
548548
favicon: project.favicon,
549-
branch: project.id === HERO_PROJECT_ID ? "perf/stream-provider-output" : undefined,
549+
// Spread rather than pass `undefined`: `branch` is an optional property,
550+
// and exactOptionalPropertyTypes rejects an explicit undefined for it.
551+
...(project.id === HERO_PROJECT_ID ? { branch: "perf/stream-provider-output" } : {}),
550552
});
551553
}
552554
const dbPath = NodePath.join(baseDir, "userdata", "state.sqlite");
@@ -559,9 +561,9 @@ const invokedDirectly = process.argv[1]?.endsWith("marketing-screenshot-environm
559561
if (invokedDirectly) {
560562
const baseDir = process.argv[2];
561563
if (!baseDir) {
562-
console.error("Usage: node scripts/marketing-screenshot-environment.ts <base-dir>");
564+
process.stderr.write("Usage: node scripts/marketing-screenshot-environment.ts <base-dir>\n");
563565
process.exit(1);
564566
}
565567
const dbPath = await seedMarketingEnvironment(NodePath.resolve(baseDir));
566-
console.log(`Seeded marketing fixture into ${dbPath}`);
568+
process.stdout.write(`Seeded marketing fixture into ${dbPath}\n`);
567569
}

0 commit comments

Comments
 (0)