Skip to content

Commit bb5eb64

Browse files
authored
Merge pull request #802 from crazywhalecc/feat/safe-pack
Check lib-suggest before packing libs
2 parents 9af3b74 + 1409d1b commit bb5eb64

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/SPC/command/dev/PackLibCommand.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,15 @@ public function handle(): int
4242

4343
$builder->proveLibs($libraries);
4444
$builder->validateLibsAndExts();
45+
46+
// before pack, check if the dependency tree contains lib-suggests
47+
foreach ($libraries as $lib) {
48+
if (Config::getLib($lib, 'lib-suggests', []) !== []) {
49+
logger()->critical("The library {$lib} has lib-suggests, packing [{$lib_name}] is not safe, abort !");
50+
return static::FAILURE;
51+
}
52+
}
53+
4554
foreach ($builder->getLibs() as $lib) {
4655
if ($lib->getName() !== $lib_name) {
4756
// other dependencies: install or build, both ok

0 commit comments

Comments
 (0)