Skip to content
This repository has been archived by the owner on Mar 26, 2018. It is now read-only.

Commit

Permalink
Added a command line option to ignore dev dependencies. Off by default.
Browse files Browse the repository at this point in the history
  • Loading branch information
MasterAM committed Jan 30, 2015
1 parent 2c8a0db commit 05278fa
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
15 changes: 8 additions & 7 deletions gh/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand All @@ -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));
Expand Down
4 changes: 3 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,16 @@ 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
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:
Expand Down

0 comments on commit 05278fa

Please sign in to comment.