show command by default

main
Rob Bast 9 years ago
parent cbd61660ab
commit 9223f4a208

@ -172,9 +172,7 @@ class EventDispatcher
} else {
$args = implode(' ', array_map(array('Composer\Util\ProcessExecutor', 'escape'), $event->getArguments()));
$exec = $callable . ($args === '' ? '' : ' '.$args);
if ($this->io->isVerbose()) {
$this->io->writeError(sprintf('> %s', $exec));
}
$this->io->writeError(sprintf('> %s', $exec));
if (0 !== ($exitCode = $this->process->execute($exec))) {
$this->io->writeError(sprintf('<error>Script %s handling the %s event returned with an error</error>', $callable, $event->getName()));

@ -150,7 +150,7 @@ class EventDispatcherTest extends TestCase
);
}
public function testDispatcherOutputsCommandsInVerboseMode()
public function testDispatcherOutputsCommand()
{
$dispatcher = $this->getMockBuilder('Composer\EventDispatcher\EventDispatcher')
->setConstructorArgs(array(
@ -166,10 +166,6 @@ class EventDispatcherTest extends TestCase
->method('getListeners')
->will($this->returnValue($listener));
$io->expects($this->once())
->method('isVerbose')
->willReturn(true);
$io->expects($this->once())
->method('writeError')
->with($this->equalTo('> echo foo'));
@ -196,7 +192,11 @@ class EventDispatcherTest extends TestCase
->method('getListeners')
->will($this->returnValue($listener));
$io->expects($this->once())
$io->expects($this->at(0))
->method('writeError')
->willReturn('> exit 1');
$io->expects($this->at(1))
->method('writeError')
->with($this->equalTo('<error>Script '.$code.' handling the post-install-cmd event returned with an error</error>'));

Loading…
Cancel
Save