mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-17 20:34:51 +08:00
Add dump license files after installing
This commit is contained in:
parent
19e11caa83
commit
a6c79e30a8
@ -17,6 +17,7 @@ use StaticPHP\Util\DependencyResolver;
|
||||
use StaticPHP\Util\FileSystem;
|
||||
use StaticPHP\Util\GlobalEnvManager;
|
||||
use StaticPHP\Util\InteractiveTerm;
|
||||
use StaticPHP\Util\LicenseDumper;
|
||||
use StaticPHP\Util\V2CompatLayer;
|
||||
use ZM\Logger\ConsoleColor;
|
||||
|
||||
@ -208,6 +209,11 @@ class PackageInstaller
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->dumpLicenseFiles($this->packages);
|
||||
if ($interactive) {
|
||||
InteractiveTerm::success('Exported package licenses', true);
|
||||
}
|
||||
}
|
||||
|
||||
public function isBuildPackage(Package|string $package): bool
|
||||
@ -460,6 +466,21 @@ class PackageInstaller
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Package[] $packages
|
||||
*/
|
||||
private function dumpLicenseFiles(array $packages): void
|
||||
{
|
||||
$dumper = new LicenseDumper();
|
||||
foreach ($packages as $package) {
|
||||
$artifact = $package->getArtifact();
|
||||
if ($artifact !== null) {
|
||||
$dumper->addArtifacts([$artifact->getName()]);
|
||||
}
|
||||
}
|
||||
$dumper->dump(BUILD_ROOT_PATH . '/license');
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate that a package has required artifacts.
|
||||
*/
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user