Skip to content

Commit 9d67c2f

Browse files
committed
fix broken gen
1 parent 83fc130 commit 9d67c2f

File tree

1 file changed

+32
-19
lines changed

1 file changed

+32
-19
lines changed

app/index.js

Lines changed: 32 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,42 @@
11
var fs = require('fs');
22
var path = require('path');
33
var chalk = require('chalk');
4+
var yeoman = require('yeoman-generator');
5+
var util = require('util');
46

5-
var Generator = module.exports = function() {
6-
var prompts = [];
7-
var files = this.expandFiles('**/*', { cwd: this.sourceRoot(), dot: true });
8-
var ignores = [
9-
'.git',
10-
'LICENSE',
11-
'README.md',
12-
];
7+
module.exports = yeoman.generators.Base.extend({
138

14-
this.package = JSON.parse(this.readFileAsString(path.join(__dirname, '../package.json')));
9+
constructor: function () {
10+
yeoman.generators.Base.apply(this, arguments);
1511

16-
this.log.writeln('Generating from ' + chalk.cyan('jQuery Boilerplate') + ' v' + chalk.cyan(this.package.version) + '...');
12+
},
1713

18-
files.forEach(function(file) {
19-
if (ignores.indexOf(file) !== -1) {
20-
return;
21-
}
14+
install: function () {
15+
var prompts = [];
2216

23-
this.copy(file, file);
24-
}, this);
17+
this.name = "jQuery Boilerplate";
2518

26-
this.config.save();
27-
};
19+
this.files = this.expandFiles('**/*', { cwd: this.sourceRoot(), dot: true });
2820

29-
Generator.name = "jQuery Boilerplate";
21+
var ignores = [
22+
'.git',
23+
'LICENSE',
24+
'README.md',
25+
];
26+
27+
this.files.forEach(function(file) {
28+
if (ignores.indexOf(file) !== -1) {
29+
return;
30+
}
31+
32+
this.copy(file, file);
33+
}, this);
34+
35+
this.config.save();
36+
37+
this.package = JSON.parse(this.readFileAsString(path.resolve(__dirname, '../package.json')));
38+
39+
this.log.writeln('Generating from ' + chalk.cyan('jQuery Boilerplate') + ' v' + chalk.cyan(this.package.version) + '...');
40+
}
41+
42+
});

0 commit comments

Comments
 (0)