From 5430f9a792e4a1028ce50294a10985105778ae22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20=C3=81ngel?= Date: Sun, 29 Mar 2026 11:03:52 +0000 Subject: [PATCH] fix(cli): catch output directory creation errors in render mkdirSync for the render output path was not wrapped in try-catch, exposing a raw Node.js EACCES stack trace when the path was invalid or permissions were denied. Reproducer: npx hyperframes render --output /root/nope/output.mp4 # Was: raw "Error: EACCES: permission denied" with stack trace # Now: clean "Cannot create output directory" error box --- packages/cli/src/commands/render.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/packages/cli/src/commands/render.ts b/packages/cli/src/commands/render.ts index 4f1ff6818..71f1d9197 100644 --- a/packages/cli/src/commands/render.ts +++ b/packages/cli/src/commands/render.ts @@ -126,7 +126,17 @@ Examples: : join(rendersDir, `${project.name}_${datePart}_${timePart}${ext}`); // Ensure output directory exists - mkdirSync(dirname(outputPath), { recursive: true }); + try { + mkdirSync(dirname(outputPath), { recursive: true }); + } catch (err: unknown) { + const message = err instanceof Error ? err.message : String(err); + errorBox( + "Cannot create output directory", + `${dirname(outputPath)}: ${message}`, + "Check that you have write permission or specify a different path with --output.", + ); + process.exit(1); + } const useDocker = args.docker ?? false; const useGpu = args.gpu ?? false;