Skip to content

Commit ef3f1c0

Browse files
authored
Merge pull request #49 from Niklan/add-custom-options-for-composer-generator
Add support for other Drupal specific package types into Composer generator
2 parents ab8a3f1 + 40b755d commit ef3f1c0

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

src/Command/Composer.php

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,28 @@ protected function generate(array &$vars): void {
2727
$type_question->setValidator([self::class, 'validateRequired']);
2828
$type_question->setAutocompleterValues([
2929
'drupal-module',
30+
'drupal-custom-module',
3031
'drupal-theme',
32+
'drupal-custom-theme',
3133
'drupal-library',
3234
'drupal-profile',
35+
'drupal-custom-profile',
3336
'drupal-drush',
3437
]);
3538
$vars['type'] = $this->io->askQuestion($type_question);
3639

37-
$vars['drupal_org'] = $this->confirm('Is this project hosted on drupal.org?', FALSE);
40+
$custom_types = [
41+
'drupal-custom-module',
42+
'drupal-custom-theme',
43+
'drupal-custom-profile',
44+
];
45+
if (!\in_array($vars['type'], $custom_types)) {
46+
// If project type is custom, there is no reason to ask this.
47+
$vars['drupal_org'] = $this->confirm('Is this project hosted on drupal.org?', FALSE);
48+
}
49+
else {
50+
$vars['drupal_org'] = FALSE;
51+
}
3852

3953
$this->addFile('composer.json', 'composer');
4054
}

0 commit comments

Comments
 (0)