Skip to content
This repository was archived by the owner on Nov 2, 2024. It is now read-only.

Commit 1f55aae

Browse files
committed
Code cleanup
1 parent 3c55fc6 commit 1f55aae

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/DrupalInitCommand.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ protected function configure()
3333
new InputOption('homepage', null, InputOption::VALUE_REQUIRED, 'Homepage of package'),
3434
new InputOption('require', null, InputOption::VALUE_IS_ARRAY | InputOption::VALUE_REQUIRED, 'Package to require with a version constraint, e.g. foo/bar:1.0.0 or foo/bar=1.0.0 or "foo/bar 1.0.0"'),
3535
new InputOption('require-dev', null, InputOption::VALUE_IS_ARRAY | InputOption::VALUE_REQUIRED, 'Package to require for development with a version constraint, e.g. foo/bar:1.0.0 or foo/bar=1.0.0 or "foo/bar 1.0.0"'),
36-
new InputOption('core', 'c', InputOption::VALUE_REQUIRED, 'Drupal Core or distribution with a version constraint, e.g. drupal/core or acquia/lightning~2.1 or "drupal/core 8.4.0"', 'drupal/core:^8.4'),
36+
new InputOption('core', 'c', InputOption::VALUE_REQUIRED, 'Drupal Core or distribution, e.g. drupal/core or acquia/lightning', 'drupal/core'),
3737
new InputOption('stability', 's', InputOption::VALUE_REQUIRED, 'Minimum stability (empty or one of: '.implode(', ', array_keys(BasePackage::$stabilities)).')'),
3838
new InputOption('license', 'l', InputOption::VALUE_REQUIRED, 'License of package'),
3939
new InputOption('repository', null, InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'Add custom repositories, either by URL or using JSON arrays'),
@@ -56,7 +56,6 @@ protected function execute(InputInterface $input, OutputInterface $output)
5656
{
5757
$options = $input->getOptions();
5858

59-
// @todo: Provide an option to select a distribution.
6059
$options['require'] = array_merge([
6160
'cweagans/composer-patches ^1.6.0',
6261
'hussainweb/drupal-composer-helper ^1.0',
@@ -296,10 +295,8 @@ protected function getCore(InputInterface $input)
296295
{
297296
$io = $this->getIO();
298297

299-
$core = $input->getOption('core') ?: false;
300-
$core_version = $this->normalizeRequirements((array) $core);
301-
$core_version = reset($core_version);
302-
$core_package = $core_version['name'];
298+
$name_version_pair = $this->normalizeRequirements((array) $input->getOption('core'));
299+
$core_package = $name_version_pair[0]['name'];
303300

304301
$core_package = $io->askAndValidate(
305302
'Drupal core or distribution [<comment>'.$core_package.'</comment>]: ',

0 commit comments

Comments
 (0)