1
0
Fork 0

Merge pull request #6377 from CupOfTea696/feature/init-command-skip-interactive-require-if-set-by-option

Auto-skip interactive require when set by option.
pull/4865/merge
Jordi Boggiano 2017-05-16 23:26:26 +02:00 committed by GitHub
commit a86f1a8969
1 changed files with 6 additions and 4 deletions

View File

@ -299,16 +299,18 @@ EOT
$io->writeError(array('', 'Define your dependencies.', ''));
$question = 'Would you like to define your dependencies (require) interactively [<comment>yes</comment>]? ';
$require = $input->getOption('require');
$requirements = array();
if ($io->askConfirmation($question, true)) {
$requirements = $this->determineRequirements($input, $output, $input->getOption('require'));
if ($require || $io->askConfirmation($question, true)) {
$requirements = $this->determineRequirements($input, $output, $require);
}
$input->setOption('require', $requirements);
$question = 'Would you like to define your dev dependencies (require-dev) interactively [<comment>yes</comment>]? ';
$requireDev = $input->getOption('require-dev');
$devRequirements = array();
if ($io->askConfirmation($question, true)) {
$devRequirements = $this->determineRequirements($input, $output, $input->getOption('require-dev'));
if ($requireDev || $io->askConfirmation($question, true)) {
$devRequirements = $this->determineRequirements($input, $output, $requireDev);
}
$input->setOption('require-dev', $devRequirements);
}