From a375ab97805fb219c7adaaafb99521a87eecec98 Mon Sep 17 00:00:00 2001 From: crazywhalecc Date: Fri, 25 Jul 2025 11:29:53 +0800 Subject: [PATCH] Fix custom pkg download callable not working bug --- src/SPC/store/Downloader.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/SPC/store/Downloader.php b/src/SPC/store/Downloader.php index ed462489..c9b71c86 100644 --- a/src/SPC/store/Downloader.php +++ b/src/SPC/store/Downloader.php @@ -368,6 +368,11 @@ class Downloader break; case 'custom': // Custom download method, like API-based download or other $classes = FileSystem::getClassesPsr4(ROOT_DIR . '/src/SPC/store/pkg', 'SPC\store\pkg'); + if (isset($pkg['func']) && is_callable($pkg['func'])) { + $pkg['name'] = $name; + $pkg['func']($force, $pkg, SPC_DOWNLOAD_PACKAGE); + break; + } foreach ($classes as $class) { if (is_a($class, CustomPackage::class, true) && $class !== CustomPackage::class) { $cls = new $class();