Abort setup when create-vue is interrupted or cancelled

create-vue exits 0 when its prompts are cancelled, so a zero return code
is not proof of success: also require frontend/package.json to exist, and
treat Ctrl-C (KeyboardInterrupt) as failure instead of a traceback. The
caller already exits 1 on failure, so the setup no longer continues with
a missing or partial frontend.
This commit is contained in:
LeoVasanko committed 2026-10-27 22:40:35 +00:00
1 parent c9557d4308
commit 218c9e203b
1 file changed
+9 -3
+9 -3
View File
@@ -1499,9 +1499,15 @@ def ensure_frontend(
if not vue_args:
print("(Follow the prompts to configure your Vue app)")
print()
result = subprocess.run(create_cmd, cwd=project_dir, check=False) # noqa: S603
if result.returncode != 0:
print("❌ create-vue failed")
try:
result = subprocess.run(create_cmd, cwd=project_dir, check=False) # noqa: S603
except KeyboardInterrupt:
print("\n❌ create-vue interrupted")
return False
# create-vue exits 0 when its prompts are cancelled, so a zero return
# code alone doesn't mean a project was created.
if result.returncode != 0 or not package_json.exists():
print("❌ create-vue failed or was cancelled")
return False
return True