Skip to content
Browse files

Option to skip automatic install via bower/npm

  • Loading branch information...
1 parent a84a7fa commit 4cb934d7a12f3e13eac7f8b480dc42f264aa5d28 @passy passy committed
Showing with 24 additions and 5 deletions.
  1. +8 −4 app/index.js
  2. +13 −0 readme.md
  3. +3 −1 test/test.js
View
12 app/index.js
@@ -24,13 +24,17 @@ var AppGenerator = module.exports = function Appgenerator(args, options, config)
this.mainCoffeeFile = 'console.log "\'Allo from CoffeeScript!"';
this.on('end', function () {
- console.log('\n\nI\'m all done. Running ' + 'npm install & bower install'.bold.yellow + ' for you to install the required dependencies. If this fails, try running the command yourself.\n\n');
- spawn('npm', ['install'], { stdio: 'inherit' });
- spawn('bower', ['install'], { stdio: 'inherit' });
+ if (options['skip-install']) {
@sindresorhus Yeoman member

@passy can you document this option? and add it to the Angular generator too, if you've not already done it :)

@passy Yeoman member
@sindresorhus Yeoman member

k

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
+ console.log('\n\nI\'m all done. Just run ' + 'npm install & bower install --dev'.bold.yellow + ' to install the required dependencies.\n\n');
+ } else {
+ console.log('\n\nI\'m all done. Running ' + 'npm install & bower install'.bold.yellow + ' for you to install the required dependencies. If this fails, try running the command yourself.\n\n');
+ spawn('npm', ['install'], { stdio: 'inherit' });
+ spawn('bower', ['install'], { stdio: 'inherit' });
+ }
});
this.pkg = JSON.parse(this.readFileAsString(path.join(__dirname, '../package.json')));
-}
+};
util.inherits(AppGenerator, yeoman.generators.NamedBase);
View
13 readme.md
@@ -3,6 +3,19 @@
Default Yeoman generator for scaffolding out a front-end web app.
+## Options
+
+* `--skip-install`
+
+ Skips the automatic execution of `bower` and `npm` after
+ scaffolding has finished.
+
+* `--test-framework=[framework]`
+
+ Defaults to `mocha`. Can be switched for
+ another supported testing framework like `jasmine`.
+
+
## Contribute
See the [contributing docs](https://github.com/yeoman/yeoman/blob/master/contributing.md)
View
4 test/test.js
@@ -1,4 +1,4 @@
-/*global describe beforeEach it*/
+/*global describe, beforeEach, it*/
var path = require('path');
var helpers = require('yeoman-generator').test;
@@ -46,6 +46,7 @@ describe('Webapp generator test', function () {
'includeRequireJS': 'N'
});
+ this.webapp.options['skip-install'] = true;
this.webapp.run({}, function () {
helpers.assertFiles(expected);
done();
@@ -70,6 +71,7 @@ describe('Webapp generator test', function () {
'includeRequireJS': 'Y'
});
+ this.webapp.options['skip-install'] = true;
this.webapp.run({}, function () {
helpers.assertFiles(expected);
done();

0 comments on commit 4cb934d

Please sign in to comment.
Something went wrong with that request. Please try again.