From e9f4f3738ba6ea39903fac8e56d29259177adc13 Mon Sep 17 00:00:00 2001 From: Sondre Nilsen Date: Sun, 5 Jun 2016 03:10:19 +0200 Subject: [PATCH] Add skip install message --- generators/update/index.js | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/generators/update/index.js b/generators/update/index.js index 6679f41..f9b4055 100644 --- a/generators/update/index.js +++ b/generators/update/index.js @@ -1,10 +1,17 @@ 'use strict'; var generators = require('yeoman-generator'); +var chalk = require('chalk'); 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 @@ -45,8 +52,20 @@ module.exports = generators.Base.extend({ install: function () { this.installDependencies({ bower: false, + skipMessage: this.options['skip-install-message'], skipInstall: this.options['skip-install'] }); this.spawnCommand('bundle', ['install', '--quiet']); - } + }, + + end: function () { + var skipInstallMessage = + '\nPlease run ' + chalk.blue('npm install') + ' and ' + + chalk.blue('bundle install') + ' to install dependencies\n'; + + if (this.options['skip-install']) { + this.log(skipInstallMessage); + return; + } + } });