Skip to content

Commit

Permalink
fix(app generator): Refrain from doing an npm install without argum…
Browse files Browse the repository at this point in the history
…ents so that its 'prepublish' script isn't run.

Explicitly log a message, vaguely similar to what `#installDependencies()` did implicitly.
Do not say that a failed npm install can be retried by hand, because that won't work.
  • Loading branch information
cueedee committed May 7, 2015
1 parent b5a47e9 commit 781b1d5
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions generators/app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ var generators = require( 'yeoman-generator' )
, yosay = require( 'yosay' )
, youtil = require( './../../lib/youtil.js' )
, mkdirp = require( 'mkdirp' )
, chalk = require( 'chalk' )
, _ = require( 'lodash' )
;

Expand Down Expand Up @@ -280,6 +281,8 @@ var AppGenerator = generators.Base.extend(

, install: function ()
{
/* jshint laxbreak: true */

var data = this.templateData
, deps =
[
Expand Down Expand Up @@ -320,20 +323,15 @@ var AppGenerator = generators.Base.extend(
deps.push( 'madlib-locale' );
}

this.log( chalk.bold(
'\n'
+ 'Running a number of "'
+ chalk.yellow( 'npm install ' + chalk.cyan( '<package>' ) + ' --save' + chalk.cyan( '[' ) + '-dev' + chalk.cyan( ']' ))
+ '"s for you to install required dependencies.'
));

this.npmInstall( deps, { save: true } );
this.npmInstall( devDeps, { saveDev: true } );

// Merely cause the "I'm all done. Running 'npm install' for you to ..." message to be outputted.
// Because of the `.npmInstal()`s above, setting 'skipInstall' to `true` here would do nothing to prevent those.
//
this.installDependencies(
{
bower: false
, npm: true
, skipInstall: false
, skipMessage: false
}
);
}
}
);
Expand Down

0 comments on commit 781b1d5

Please sign in to comment.