Skip to content

Commit

Permalink
Merge 25c3495 into c7503a4
Browse files Browse the repository at this point in the history
  • Loading branch information
moufmouf committed Jan 5, 2018
2 parents c7503a4 + 25c3495 commit 54bc0dd
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/AssetsBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,16 @@ public function findAssetTypes(RepositoryInterface $repository) : array
{
$unorderedPackagesList = $repository->getPackages();

$orderedPackageList = PackagesOrderer::reorderPackages($unorderedPackagesList);
// For some weird reason, some packages can be in double in the repository.
// This has been observed when doing a "composer install" on an empty vendor directory.
// Let's ensure each package is represented only once.
$dedupPackages = [];
foreach($unorderedPackagesList as $package) {
$dedupPackages[$package->getName()] = $package;
}
$dedupPackages = array_values($dedupPackages);

$orderedPackageList = PackagesOrderer::reorderPackages($dedupPackages);

$packages = array_filter($orderedPackageList, function (PackageInterface $package) {
$packageInstallPath = $this->getInstallPath($package);
Expand Down

0 comments on commit 54bc0dd

Please sign in to comment.