From 4c09f63ae2cb52c70f095a8ea880466c7d6ce0b7 Mon Sep 17 00:00:00 2001 From: dyzulk <66510723+dyzulk@users.noreply.github.com> Date: Sun, 18 Jan 2026 17:26:39 +0700 Subject: [PATCH] fix(registry): restore metadata parsing logic --- scripts/generate_registry.php | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/scripts/generate_registry.php b/scripts/generate_registry.php index eb6e443..5142cc0 100644 --- a/scripts/generate_registry.php +++ b/scripts/generate_registry.php @@ -64,8 +64,21 @@ foreach ($repos as $repo) { } // 4. Parse Metadata - // ... - // (Parsing login remains the same) + // Regex looking for: * Key: Value + preg_match_all('/^\s*\*\s*([a-zA-Z0-9 ]+):\s*(.+)$/m', $pluginContent, $matches, PREG_SET_ORDER); + + $metadata = []; + foreach ($matches as $match) { + $key = strtolower(trim($match[1])); + $value = trim($match[2]); + $metadata[$key] = $value; + } + + // fallback if name is missing + if (empty($metadata['plugin name'])) { + echo " - Warning: 'Plugin Name' header missing. Skipping.\n"; + continue; + } // Determine Download URL & Version $downloadUrl = $repo['html_url'] . '/archive/refs/heads/' . $repo['default_branch'] . '.zip';