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

Commit 05278fa

Browse files
committed
Added a command line option to ignore dev dependencies. Off by default.
1 parent 2c8a0db commit 05278fa

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

gh/index.js

+8-7
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@ var spawn = require('child_process').spawn;
77
var rimraf = require('rimraf');
88

99
module.exports = yeoman.generators.Base.extend({
10+
constructor: function () {
11+
yeoman.generators.Base.apply(this, arguments);
12+
this.option('nodevdeps', {
13+
desc: 'Whether devDependencies should be installed in the gh-pages branch',
14+
default: false
15+
});
16+
this.includeDevDeps = this.options.nodevdeps ? 'no' : 'yes';
17+
},
1018
askFor: function () {
1119
var done = this.async();
1220

@@ -23,19 +31,12 @@ module.exports = yeoman.generators.Base.extend({
2331
name: 'elementName',
2432
message: 'What is your element\'s name',
2533
default: defaultName
26-
},
27-
{
28-
name: 'includeDevDeps',
29-
message: 'Would you like to include the devDependencies from your bower.json file?',
30-
type: 'confirm',
31-
default: false
3234
}
3335
];
3436

3537
this.prompt(prompts, function (props) {
3638
this.ghUser = props.ghUser;
3739
this.elementName = props.elementName;
38-
this.includeDevDeps = props.includeDevDeps ? 'yes' : 'no';
3940

4041
done();
4142
}.bind(this));

readme.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -91,14 +91,16 @@ yo polymer:seed x-foo
9191
### Gh
9292
Generates a Github pages branch for your [seed-element](#seed).
9393

94-
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.
94+
If your documentation or demo pages have dependencies declared as devDependencies in `bower.json`, they will be included in your GitHub pages branch.
9595

9696
Example:
9797
```bash
9898
cd components/x-foo
9999
yo polymer:gh
100100
```
101101

102+
If, for some reason, you don't want the devDependencies, use the `--nodevdeps` option.
103+
102104
## Testing
103105

104106
The project generated by `yo polymer` contains support for [web-component-tester](https://github.com/Polymer/web-component-tester). The following commands are included:

0 commit comments

Comments
 (0)