1
0
Fork 0
mirror of https://github.com/composer/composer synced 2025-05-10 09:02:59 +00:00

Implement writeError throughout Composer

This commit is contained in:
Rob Bast 2015-02-06 13:52:44 +01:00
parent 84d4594278
commit cb336a5416
65 changed files with 390 additions and 322 deletions

View file

@ -66,7 +66,7 @@ EOT
protected function execute(InputInterface $input, OutputInterface $output)
{
if ($input->getOption('list')) {
return $this->listScripts($input, $output);
return $this->listScripts();
} elseif (!$input->getArgument('script')) {
throw new \RunTimeException('Missing required argument "script"');
}
@ -95,7 +95,7 @@ EOT
return $composer->getEventDispatcher()->dispatchScript($script, $input->getOption('dev') || !$input->getOption('no-dev'), $args);
}
protected function listScripts(InputInterface $input, OutputInterface $output)
protected function listScripts()
{
$scripts = $this->getComposer()->getPackage()->getScripts();
@ -103,9 +103,9 @@ EOT
return 0;
}
$output->writeln('<info>scripts:</info>');
$this->getIO()->writeError('<info>scripts:</info>');
foreach ($scripts as $name => $script) {
$output->writeln(' ' . $name);
$this->getIO()->write(' ' . $name);
}
return 0;