From 31c4b86d6e39f3993a570c5c4640097f38aff6eb Mon Sep 17 00:00:00 2001 From: Jonathan Miller Date: Mon, 25 May 2026 19:49:27 -0500 Subject: [PATCH] fix: package_build.php create output directory if missing ZipArchive::close() fails when the output directory doesn't exist. Now creates it with mkdir -p equivalent before writing. Authored-by: Moko Consulting Co-Authored-By: Claude Opus 4.6 (1M context) --- cli/package_build.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cli/package_build.php b/cli/package_build.php index 82dc838..ae4e95b 100644 --- a/cli/package_build.php +++ b/cli/package_build.php @@ -65,6 +65,11 @@ if ($version === null) { $root = realpath($path) ?: $path; +// Ensure output directory exists +if (!is_dir($outputDir)) { + mkdir($outputDir, 0755, true); +} + // -- Determine source directory ----------------------------------------------- $sourceDir = null; foreach (['src', 'htdocs'] as $candidate) {