fix(cli): handle init -V with explicit migration error

This commit is contained in:
WadydX
2026-05-10 21:31:17 +01:00
parent e61d1fe002
commit 2778845bd3
3 changed files with 53 additions and 4 deletions
+29 -1
View File
@@ -136,7 +136,15 @@ describe("hyperframes init flag rename", () => {
const dir = mkdtempSync(join(tmpdir(), "hf-init-test-"));
const target = join(dir, "proj");
try {
const res = runInit([target, "--example", "blank", "--non-interactive", "--skip-skills", "-v", "missing.mp4"]);
const res = runInit([
target,
"--example",
"blank",
"--non-interactive",
"--skip-skills",
"-v",
"missing.mp4",
]);
expect(res.status).toBe(1);
expect(res.stderr).toContain("Video file not found: missing.mp4");
} finally {
@@ -144,6 +152,26 @@ describe("hyperframes init flag rename", () => {
}
});
it("-V prints a migration error instead of version fast-path", () => {
const dir = mkdtempSync(join(tmpdir(), "hf-init-test-"));
const target = join(dir, "proj");
try {
const res = runInit([
target,
"--example",
"blank",
"--non-interactive",
"--skip-skills",
"-V",
"missing.mp4",
]);
expect(res.status).toBe(1);
expect(res.stderr).toContain("The -V short flag no longer maps to --video");
} finally {
rmSync(dir, { recursive: true, force: true });
}
});
it("--template prints a rename hint and exits non-zero", () => {
const dir = mkdtempSync(join(tmpdir(), "hf-init-test-"));
const target = join(dir, "proj");