Allow fallback to builder options

This commit is contained in:
crazywhalecc
2026-04-12 01:11:48 +08:00
parent ec399052ed
commit 626bdc3509

View File

@@ -80,6 +80,14 @@ class TargetPackage extends LibraryPackage
if ($input !== null && $input->hasOption($key)) {
return $input->getOption($key);
}
// try builder options
$builder = ApplicationContext::has(PackageBuilder::class)
? ApplicationContext::get(PackageBuilder::class)
: null;
if ($builder !== null && ($option = $builder->getOption($key)) !== null) {
return $option;
}
return $default;
}