From 77457ca4742f46d1e606dcd443a52d3323177541 Mon Sep 17 00:00:00 2001 From: Mariusz Zarzycki Date: Mon, 8 Oct 2018 20:35:06 +0100 Subject: [PATCH] Show command respects --path flag Path added to package meta output --- src/Composer/Command/ShowCommand.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Composer/Command/ShowCommand.php b/src/Composer/Command/ShowCommand.php index ccea6a960..6de2f4cab 100644 --- a/src/Composer/Command/ShowCommand.php +++ b/src/Composer/Command/ShowCommand.php @@ -219,6 +219,12 @@ EOT if ($input->getOption('outdated') && $input->getOption('strict') && $latestPackage && $latestPackage->getFullPrettyVersion() !== $package->getFullPrettyVersion() && !$latestPackage->isAbandoned()) { $exitCode = 1; } + if ($input->getOption('path')) { + $io->write($package->getName(), false); + $io->write(' ' . strtok(realpath($composer->getInstallationManager()->getInstallPath($package)), "\r\n")); + + return $exitCode; + } $this->printMeta($package, $versions, $installedRepo, $latestPackage ?: null); $this->printLinks($package, 'requires'); $this->printLinks($package, 'devRequires', 'requires (dev)'); @@ -577,6 +583,7 @@ EOT $this->printLicenses($package); $io->write('source : ' . sprintf('[%s] %s %s', $package->getSourceType(), $package->getSourceUrl(), $package->getSourceReference())); $io->write('dist : ' . sprintf('[%s] %s %s', $package->getDistType(), $package->getDistUrl(), $package->getDistReference())); + $io->write('path : ' . sprintf('%s', realpath($this->getComposer()->getInstallationManager()->getInstallPath($package)))); $io->write('names : ' . implode(', ', $package->getNames())); if ($latestPackage->isAbandoned()) {