Skip to content

Commit

Permalink
updated plugin list to add nested pages instead of simple page ordering
Browse files Browse the repository at this point in the history
  • Loading branch information
mattbob committed Dec 5, 2014
1 parent b63c5a6 commit 9b3601b
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 29 deletions.
34 changes: 15 additions & 19 deletions app/index.js
Expand Up @@ -116,7 +116,7 @@ Generator.prototype.installWP = function() {
me = this;

this.logger.log('Installing WordPress');
this.tarball('https://github.com/wordpress/wordpress/archive/master.tar.gz', '.', done);
this.tarball('http://wordpress.org/latest.zip', '.', done);
};

Generator.prototype.configSetup = function() {
Expand All @@ -140,9 +140,9 @@ Generator.prototype.createLocalConfig = function() {

Generator.prototype.setPermissions = function() {
if (fs.existsSync('.')) {
this.logger.log('Setting Permissions: 0755 on .');
this.logger.log('Setting permissions: 0755 on ./');
wrench.chmodSyncRecursive('.', 0755);
this.logger.verbose('Done setting permissions on .');
this.logger.verbose('Done setting permissions on ./');
}
};

Expand Down Expand Up @@ -171,7 +171,7 @@ Generator.prototype.installTheme = function() {
var done = this.async()
me = this;

this.logger.log('Setting up theme');
this.logger.log('Installing theme');
wordpress.installTheme(this, this.conf.get(), function() {
me.logger.verbose('Theme install complete');
done();
Expand Down Expand Up @@ -199,16 +199,6 @@ Generator.prototype.installMenuEditor = function() {
}
};

Generator.prototype.installGoogleSitemapGenerator = function() {
var plugins = this.conf.get('pluginsList');

if(plugins.indexOf('googleSitemapGenerator') > -1) {
var done = this.async();
this.logger.log('Installing Google Sitemap Generator plugin');
this.tarball('https://github.com/wp-plugins/google-sitemap-generator/archive/master.tar.gz', 'wp-content/plugins/google-sitemap-generator', done);
}
};

Generator.prototype.installGFplugin = function() {
var plugins = this.conf.get('pluginsList');

Expand All @@ -229,13 +219,13 @@ Generator.prototype.installHelpfulInformation = function() {
}
};

Generator.prototype.installSPOplugin = function() {
Generator.prototype.installNestedPages = function() {
var plugins = this.conf.get('pluginsList');

if(plugins.indexOf('simplePageOrdering') > -1) {
if(plugins.indexOf('nestedPages') > -1) {
var done = this.async();
this.logger.log('Installing Simple Page Ordering plugin');
this.tarball('https://github.com/wp-plugins/simple-page-ordering/archive/master.tar.gz', 'wp-content/plugins/simple-page-ordering', done);
this.logger.log('Installing Nested Pages plugin');
this.tarball('https://github.com/wp-plugins/wp-nested-pages/archive/master.tar.gz', 'wp-content/plugins/wp-nested-pages', done);
}
};

Expand Down Expand Up @@ -295,5 +285,11 @@ Generator.prototype.saveSettings = function() {
};

Generator.prototype.finishedMessage = function() {
this.logger.log(chalk.bold.green('\nThat\'s all folks!\n'), {logPrefix: ''});
var myArray = [
'Peace and blessings.',
'That\'s all folks!',
'Keep it real, playa.'
];
var rand = myArray[Math.floor(Math.random() * myArray.length)];
this.logger.log(chalk.bold.green('\n' + rand + '\n'), {logPrefix: ''});
};
8 changes: 2 additions & 6 deletions app/prompts.js
Expand Up @@ -122,10 +122,6 @@ module.exports = function(advanced, defaults) {
name: 'Advanced Custom Fields',
value: 'ACFplugin',
checked: true
}, {
name: 'Google Sitemap Generator',
value: 'googleSitemapGenerator',
checked: true
}, {
name: 'Gravity Forms',
value: 'gravityForms',
Expand All @@ -135,8 +131,8 @@ module.exports = function(advanced, defaults) {
value: 'helpfulInformation',
checked: true
}, {
name: 'Simple Page Ordering',
value: 'simplePageOrdering',
name: 'Nested Pages',
value: 'nestedPages',
checked: true
}, {
name: 'WordPress SEO',
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "generator-mattbase",
"version": "0.2.4",
"version": "0.2.5",
"description": "A WordPress generator for Yeoman by Mattbob",
"keywords": [
"yeoman-generator",
Expand Down
5 changes: 2 additions & 3 deletions util/wordpress.js
Expand Up @@ -39,17 +39,16 @@ function installTheme(generator, config, done) {


function setupTheme(generator, config, done) {
console.log(chalk.green('Setting up theme'));

var themePath = 'wp-content/themes/' + config.themeDir,
themePackageJson = themePath + '/package.json';

if (fs.existsSync(themePackageJson)) {
var oldDir = process.cwd();
process.chdir(themePath);
console.log(chalk.green('Installing Node modules'));
exec('npm install', function(err) {
if (fs.existsSync('Gruntfile.js')) {
exec('grunt setup', function(err) {
exec('grunt', function(err) {
console.log(chalk.green('Setting up Grunt'));
process.chdir(oldDir);
done();
Expand Down

0 comments on commit 9b3601b

Please sign in to comment.