You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 2, 2024. It is now read-only.
Copy file name to clipboardExpand all lines: src/DrupalInitCommand.php
+44-1Lines changed: 44 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -3,9 +3,11 @@
3
3
namespaceHussainweb\DrupalComposerInit;
4
4
5
5
useComposer\Command\InitCommand;
6
+
useComposer\DependencyResolver\Pool;
6
7
useComposer\Factory;
7
8
useComposer\Json\JsonFile;
8
9
useComposer\Package\BasePackage;
10
+
useComposer\Package\Version\VersionSelector;
9
11
useComposer\Repository\CompositeRepository;
10
12
useComposer\Repository\PlatformRepository;
11
13
useComposer\Repository\RepositoryFactory;
@@ -31,6 +33,7 @@ protected function configure()
31
33
newInputOption('homepage', null, InputOption::VALUE_REQUIRED, 'Homepage of package'),
32
34
newInputOption('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"'),
33
35
newInputOption('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
+
newInputOption('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'),
34
37
newInputOption('stability', 's', InputOption::VALUE_REQUIRED, 'Minimum stability (empty or one of: '.implode(', ', array_keys(BasePackage::$stabilities)).')'),
35
38
newInputOption('license', 'l', InputOption::VALUE_REQUIRED, 'License of package'),
36
39
newInputOption('repository', null, InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'Add custom repositories, either by URL or using JSON arrays'),
@@ -56,7 +59,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
56
59
$options['require'] = array_merge([
57
60
'cweagans/composer-patches ^1.6.0',
58
61
'hussainweb/drupal-composer-helper ^1.0',
59
-
'drupal/core ^8.4',
62
+
$input->getOption('core'),
60
63
'drupal/console ^1.0.1',
61
64
'drush/drush ~8.0|^9.0',
62
65
], $options['require']);
@@ -260,6 +263,8 @@ function ($value) use ($self, $minimumStability) {
0 commit comments