Skip to content

Update extras for newer gadget version prompt. #14

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 5 additions & 14 deletions extras/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,17 +59,8 @@ module.exports = generators.Base.extend({
var patternCollection;
var destPath = this.options.themePath || './';

if (this.options.drupalDistro === 'drupal') {
if (this.options['drupalDistroVersion-drupal'] === '7.x') {
patternCollection = 'drupal-7.x';
}
if (this.options['drupalDistroVersion-drupal'] === '8.x') {
patternCollection = 'drupal-8.x';
}
} else if (this.options.drupalDistro === 'openatrium') {
if (this.options['drupalDistroVersion-openatrium'] === '7.x') {
patternCollection = 'openatrium-7.x';
}
if (['drupal', 'openatrium'].indexOf(this.options.drupalDistro) !== -1) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Preserved the distro validation in case other generators add distros faster than PLS.

patternCollection = this.options.drupalDistro + '-' + this.options['drupalDistroVersion'];
}

if (patternCollection) {
Expand All @@ -81,13 +72,13 @@ module.exports = generators.Base.extend({
);

if (this.options.drupalDistro === 'drupal') {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Retained the distro-by-distro breakdown to allow variations.

if (this.options['drupalDistroVersion-drupal'] === '7.x') {
if (this.options['drupalDistroVersion'] === '7.x') {
this.fs.move(
this.destinationPath(destPath) + '/' + 'pattern_lab_starter.info',
this.destinationPath(destPath) + '/' + this.options.themeName + '.info'
);
}
if (this.options['drupalDistroVersion-drupal'] === '8.x') {
if (this.options['drupalDistroVersion'] === '8.x') {
this.fs.move(
this.destinationPath(destPath) + '/' + 'pattern_lab_starter.info.yml',
this.destinationPath(destPath) + '/' + this.options.themeName + '.info.yml'
Expand All @@ -98,7 +89,7 @@ module.exports = generators.Base.extend({
);
}
} else if (this.options.drupalDistro === 'openatrium') {
if (this.options['drupalDistroVersion-openatrium'] === '7.x') {
if (this.options['drupalDistroVersion'] === '7.x') {
this.fs.move(
this.destinationPath(destPath) + '/' + 'pattern_lab_starter.info',
this.destinationPath(destPath) + '/' + this.options.themeName + '.info'
Expand Down