1
0
Fork 0

Check if input is interactive

pull/3639/head
SofHad 2015-01-30 11:53:42 +01:00
parent 1a82ecad91
commit f9777bc70a
1 changed files with 5 additions and 6 deletions

View File

@ -88,7 +88,7 @@ EOT
$packages = $input->getArgument('packages');
if ($this->isInteractive($input)) {
if ($input->getOption('interactive')) {
$packages = $this->getPackagesInteractively($input, $output, $composer, $packages);
}
@ -150,6 +150,10 @@ EOT
private function getPackagesInteractively(InputInterface $input, OutputInterface $output, Composer $composer, $packages)
{
if (!$input->isInteractive()) {
throw new \InvalidArgumentException('--interactive cannot be used in non-interactive terminals.');
}
$packagesMap = $composer->getRepositoryManager()
->getLocalRepository()->getPackages();
@ -222,9 +226,4 @@ EOT
throw new \RuntimeException('Installation aborted.');
}
private function isInteractive($input)
{
return $input->getOption('interactive');
}
}