1
0
Fork 0

Use a different way to suppress output than changing output verbosity in exec command, fixes #9711

pull/9713/head
Jordi Boggiano 2021-02-22 13:42:38 +01:00
parent 03e8cacd12
commit 8f7597da22
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
2 changed files with 2 additions and 4 deletions

View File

@ -88,9 +88,6 @@ EOT
$dispatcher = $composer->getEventDispatcher(); $dispatcher = $composer->getEventDispatcher();
$dispatcher->addListener('__exec_command', $binary); $dispatcher->addListener('__exec_command', $binary);
if ($output->getVerbosity() === OutputInterface::VERBOSITY_NORMAL) {
$output->setVerbosity(OutputInterface::VERBOSITY_QUIET);
}
// If the CWD was modified, we restore it to what it was initially, as it was // If the CWD was modified, we restore it to what it was initially, as it was
// most likely modified by the global command, and we want exec to run in the local working directory // most likely modified by the global command, and we want exec to run in the local working directory

View File

@ -226,7 +226,8 @@ class EventDispatcher
$exec = $callable . ($args === '' ? '' : ' '.$args); $exec = $callable . ($args === '' ? '' : ' '.$args);
if ($this->io->isVerbose()) { if ($this->io->isVerbose()) {
$this->io->writeError(sprintf('> %s: %s', $event->getName(), $exec)); $this->io->writeError(sprintf('> %s: %s', $event->getName(), $exec));
} else { } elseif ($event->getName() !== '__exec_command') {
// do not output the command being run when using `composer exec` as it is fairly obvious the user is running it
$this->io->writeError(sprintf('> %s', $exec)); $this->io->writeError(sprintf('> %s', $exec));
} }