Skip to content

Commit

Permalink
Merge pull request #10 from zewa666/0.2.0
Browse files Browse the repository at this point in the history
Upgraded Generator to use new Yo-API
  • Loading branch information
heldr committed Feb 25, 2015
2 parents 4a6008f + 6a26fcf commit d70cf0e
Showing 1 changed file with 21 additions and 18 deletions.
39 changes: 21 additions & 18 deletions app/index.js
Original file line number Diff line number Diff line change
@@ -1,29 +1,32 @@
var fs = require('fs');
var path = require('path');
var chalk = require('chalk');
var generators = require('yeoman-generator');

var Generator = module.exports = function() {
var prompts = [];
var files = this.expandFiles('**/*', { cwd: this.sourceRoot(), dot: true });
var ignores = [
'.git',
'LICENSE',
'README.md',
];
var Generator = module.exports = generators.Base.extend({
init: function() {
var prompts = [];
var files = this.expandFiles('**/*', { cwd: this.sourceRoot(), dot: true });
var ignores = [
'.git',
'LICENSE',
'README.md',
];

this.package = JSON.parse(this.readFileAsString(path.join(__dirname, '../package.json')));
this.package = JSON.parse(this.readFileAsString(path.join(__dirname, '../package.json')));

this.log.writeln('Generating from ' + chalk.cyan('jQuery Boilerplate') + ' v' + chalk.cyan(this.package.version) + '...');
this.log.writeln('Generating from ' + chalk.cyan('jQuery Boilerplate') + ' v' + chalk.cyan(this.package.version) + '...');

files.forEach(function(file) {
if (ignores.indexOf(file) !== -1) {
return;
}
files.forEach(function(file) {
if (ignores.indexOf(file) !== -1) {
return;
}

this.copy(file, file);
}, this);
this.copy(file, file);
}, this);

this.config.save();
};
this.config.save();
}
});

Generator.name = "jQuery Boilerplate";

0 comments on commit d70cf0e

Please sign in to comment.