Skip to content

Commit

Permalink
Avoid listing packages in PackageVersions which are not installed due…
Browse files Browse the repository at this point in the history
… to --no-dev, fixes #17
  • Loading branch information
Seldaek committed Nov 11, 2020
1 parent c8c9aa8 commit 7413f0b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/PackageVersions/Installer.php
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,11 @@ private static function getVersions(Locker $locker, RootPackageInterface $rootPa

$lockData['packages-dev'] = $lockData['packages-dev'] ?? [];

foreach (array_merge($lockData['packages'], $lockData['packages-dev']) as $package) {
$packages = $lockData['packages'];
if (getenv('COMPOSER_DEV_MODE') !== '0') {
$packages = array_merge($packages, $lockData['packages-dev']);
}
foreach ($packages as $package) {
yield $package['name'] => $package['version'] . '@' . (
$package['source']['reference'] ?? $package['dist']['reference'] ?? ''
);
Expand Down

0 comments on commit 7413f0b

Please sign in to comment.