Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions packages/cli/src/commands/init.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,19 @@ function expectScaffoldedScripts(target: string): void {
}

describe("hyperframes init flag rename", () => {
it("rejects a following flag when --example has no value", () => {
const dir = mkdtempSync(join(tmpdir(), "hf-init-test-"));
const target = join(dir, "proj");
try {
const res = runInit([target, "--example", "--non-interactive"]);
expect(res.status).toBe(1);
expect(res.stderr).toContain("--example requires a value");
expect(existsSync(target)).toBe(false);
} finally {
rmSync(dir, { recursive: true, force: true });
}
});

it("--example blank scaffolds a bundled project with npm scripts", () => {
const dir = mkdtempSync(join(tmpdir(), "hf-init-test-"));
const target = join(dir, "proj");
Expand Down
4 changes: 4 additions & 0 deletions packages/cli/src/commands/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -719,6 +719,10 @@ export default defineCommand({
process.exit(1);
}
const exampleFlag = args.example;
if (exampleFlag?.startsWith("-")) {
console.error(c.error(`--example requires a value; received flag "${exampleFlag}" instead.`));
process.exit(1);
}
const videoFlag = args.video;
const audioFlag = args.audio;
const skipTranscribe = args["skip-transcribe"] === true;
Expand Down
Loading