From 5960f715f0124d8366671348f22ab9e739f6cede Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Thu, 30 Nov 2017 15:55:57 +0100 Subject: [PATCH] Add warning in show command if no dependencies are installed but the root package has dependencies, fixes #6820 --- src/Composer/Command/ShowCommand.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Composer/Command/ShowCommand.php b/src/Composer/Command/ShowCommand.php index 08b05ad6c..48d3cf138 100644 --- a/src/Composer/Command/ShowCommand.php +++ b/src/Composer/Command/ShowCommand.php @@ -157,6 +157,10 @@ EOT $repos = new CompositeRepository(array_merge(array($installedRepo), $defaultRepos)); } else { $repos = $installedRepo = $this->getComposer()->getRepositoryManager()->getLocalRepository(); + $rootPkg = $this->getComposer()->getPackage(); + if (!$installedRepo->getPackages() && ($rootPkg->getRequires() || $rootPkg->getDevRequires())) { + $io->writeError('No dependencies installed. Try running composer install or update.'); + } } if ($composer) {