Skip to content

Commit

Permalink
Fix a few messages
Browse files Browse the repository at this point in the history
Removed the welcome message as I cannot think of anything good in it and
removed the pre-install message as well and replaced it with a custom
made one that actually explains the commands run during installation.
Also did a few fixes on the skip-install message.
  • Loading branch information
sondr3 committed Jun 6, 2016
1 parent ebd2c2c commit 29692d2
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 20 deletions.
23 changes: 10 additions & 13 deletions generators/app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ var _ = require('lodash');
var chalk = require('chalk');
var generators = require('yeoman-generator');
var shelljs = require('shelljs');
var yosay = require('yosay');
var pkg = require('../../package.json');

module.exports = generators.Base.extend({
Expand All @@ -16,9 +15,10 @@ module.exports = generators.Base.extend({
type: Boolean
});

this.option('skip-welcome-message', {
desc: 'Skips the welcome message',
type: Boolean
this.option('skip-install-message', {
desc: 'Skips the installation message',
type: Boolean,
defaults: true
});

if (!this.options['skip-install']) {
Expand All @@ -39,10 +39,6 @@ module.exports = generators.Base.extend({
},

prompting: function () {
if (!this.options['skip-welcome-message']) {
this.log(yosay(`'Allo 'allo`));
}

var questions = [{
name: 'projectName',
message: 'What is the name of your project?',
Expand Down Expand Up @@ -186,19 +182,20 @@ on Github](https://github.com/sondr3/generator-jekyllized).
installing: function () {
this.installDependencies({
bower: false,
skipMessage: this.options['skip-install-message'],
skipInstall: this.options['skip-install']
});
if (this.options['skip-install']) {
this.log('Please run bundle install to ');
} else {
this.spawnCommand('bundle', ['install', '--quiet']);
if (!this.options['skip-install']) {
this.log('\nCreating files and running ' + chalk.blue('npm install') +
' and ' + chalk.blue('bundle install') + '.\n');
this.spawnCommandSync('bundle', ['install']);
}
},

end: function () {
var skipInstallMessage =
'\nPlease run ' + chalk.blue('npm install') + ' and ' +
chalk.blue('bundle install') + ' to install dependencies';
chalk.blue('bundle install') + ' to install dependencies.\n';

if (this.options['skip-install']) {
this.log(skipInstallMessage);
Expand Down
17 changes: 10 additions & 7 deletions generators/update/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@ module.exports = generators.Base.extend({
constructor: function () {
generators.Base.apply(this, arguments);

this.option('skip-install-message', {
desc: 'Skip the post-install message',
type: Boolean,
default: true
});

this.option('skip-install', {
desc: 'Skip installing dependencies',
type: Boolean
});

this.option('skip-install-message', {
desc: 'Skips the installation message',
type: Boolean,
defaults: true
});
},

prompting: function () {
Expand Down Expand Up @@ -58,7 +58,10 @@ module.exports = generators.Base.extend({
skipMessage: this.options['skip-install-message'],
skipInstall: this.options['skip-install']
});
this.spawnCommand('bundle', ['install', '--quiet']);
if (!this.options['skip-install']) {
this.log('\nRunning ' + chalk.blue('npm install') + ' and ' + chalk.blue('bundle install') + '.\n');
this.spawnCommandSync('bundle', ['install']);
}
},

end: function () {
Expand Down

0 comments on commit 29692d2

Please sign in to comment.