diff --git a/gh/index.js b/gh/index.js index ff0f32f..2768030 100644 --- a/gh/index.js +++ b/gh/index.js @@ -7,6 +7,14 @@ var spawn = require('child_process').spawn; var rimraf = require('rimraf'); module.exports = yeoman.generators.Base.extend({ + constructor: function () { + yeoman.generators.Base.apply(this, arguments); + this.option('nodevdeps', { + desc: 'Whether devDependencies should be installed in the gh-pages branch', + default: false + }); + this.includeDevDeps = this.options.nodevdeps ? 'no' : 'yes'; + }, askFor: function () { var done = this.async(); @@ -23,19 +31,12 @@ module.exports = yeoman.generators.Base.extend({ name: 'elementName', message: 'What is your element\'s name', default: defaultName - }, - { - name: 'includeDevDeps', - message: 'Would you like to include the devDependencies from your bower.json file?', - type: 'confirm', - default: false } ]; this.prompt(prompts, function (props) { this.ghUser = props.ghUser; this.elementName = props.elementName; - this.includeDevDeps = props.includeDevDeps ? 'yes' : 'no'; done(); }.bind(this)); diff --git a/readme.md b/readme.md index 0debbfa..c744106 100644 --- a/readme.md +++ b/readme.md @@ -91,7 +91,7 @@ yo polymer:seed x-foo ### Gh Generates a Github pages branch for your [seed-element](#seed). -If your documentation or demo pages have dependencies declared as devDependencies in bower.json, you can include them in the Github pages branch by answering _yes_ to the relevant question. +If your documentation or demo pages have dependencies declared as devDependencies in `bower.json`, they will be included in your GitHub pages branch. Example: ```bash @@ -99,6 +99,8 @@ cd components/x-foo yo polymer:gh ``` +If, for some reason, you don't want the devDependencies, use the `--nodevdeps` option. + ## Testing The project generated by `yo polymer` contains support for [web-component-tester](https://github.com/Polymer/web-component-tester). The following commands are included: