Skip to content

Commit 3ae4bf7

Browse files
committed
Added destination property.
1 parent 73c60b4 commit 3ae4bf7

17 files changed

+69
-1
lines changed

src/Command/BaseGenerator.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,13 @@ abstract class BaseGenerator extends Command implements GeneratorInterface {
4848
*/
4949
protected $directory;
5050

51+
/**
52+
* The destination.
53+
*
54+
* @var mixed
55+
*/
56+
protected $destination = 'modules/%';
57+
5158
/**
5259
* Files to create.
5360
*
@@ -145,6 +152,20 @@ public function getDirectory() {
145152
return $this->directory;
146153
}
147154

155+
/**
156+
* {@inheritdoc}
157+
*/
158+
public function setDestination($destination) {
159+
$this->destination = $destination;
160+
}
161+
162+
/**
163+
* {@inheritdoc}
164+
*/
165+
public function getDestination() {
166+
return $this->destination;
167+
}
168+
148169
/**
149170
* Renders a template.
150171
*

src/Command/Drupal_7/Module.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ class Module extends BaseGenerator {
1414

1515
protected $name = 'd7:module';
1616
protected $description = 'Generates Drupal 7 module';
17+
protected $destination = 'modules';
1718

1819
/**
1920
* {@inheritdoc}

src/Command/Drupal_7/Settings.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ class Settings extends BaseGenerator {
1313

1414
protected $name = 'd7:settings.php';
1515
protected $description = 'Generates Drupal 7 settings.php file';
16+
protected $destination = 'sites/default';
1617

1718
/**
1819
* {@inheritdoc}

src/Command/Drupal_7/Theme.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ class Theme extends BaseGenerator {
1313

1414
protected $name = 'd7:theme';
1515
protected $description = 'Generates Drupal 7 theme';
16+
protected $destination = 'themes';
1617

1718
/**
1819
* {@inheritdoc}

src/Command/Drupal_8/Module/ConfigurationEntity.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ class ConfigurationEntity extends BaseGenerator {
1515
protected $name = 'd8:module:configuration-entity';
1616
protected $description = 'Generates configuration entity module';
1717
protected $alias = 'configuration-entity';
18+
protected $destination = 'modules';
1819

1920
/**
2021
* {@inheritdoc}

src/Command/Drupal_8/Module/ContentEntity.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ class ContentEntity extends BaseGenerator {
1515
protected $name = 'd8:module:content-entity';
1616
protected $description = 'Generates content entity module';
1717
protected $alias = 'content-entity';
18+
protected $destination = 'modules';
1819

1920
/**
2021
* {@inheritdoc}

src/Command/Drupal_8/Module/PluginManager.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ class PluginManager extends BaseGenerator {
1515
protected $name = 'd8:module:plugin-manager';
1616
protected $description = 'Generates plugin-manager module';
1717
protected $alias = 'plugin-manager';
18+
protected $destination = 'modules';
1819

1920
/**
2021
* {@inheritdoc}

src/Command/Drupal_8/Module/Standard.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ class Standard extends BaseGenerator {
1515
protected $name = 'd8:module:standard';
1616
protected $description = 'Generates standard Drupal 8 module';
1717
protected $alias = 'module';
18+
protected $destination = 'modules';
1819

1920
/**
2021
* {@inheritdoc}

src/Command/Drupal_8/SettingsLocal.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ class SettingsLocal extends BaseGenerator {
1414
protected $name = 'd8:settings-local';
1515
protected $description = 'Generates Drupal 8 settings.local.php file';
1616
protected $alias = 'settings.local.php';
17+
protected $destination = 'sites/default';
1718

1819
/**
1920
* {@inheritdoc}

src/Command/Drupal_8/Theme/Standard.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ class Standard extends BaseGenerator {
1616
protected $name = 'd8:theme:standard';
1717
protected $description = 'Generates standard Drupal 8 theme';
1818
protected $alias = 'theme';
19+
protected $destination = 'theme';
1920

2021
/**
2122
* {@inheritdoc}

0 commit comments

Comments
 (0)