-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from zewa666/0.2.0
Upgraded Generator to use new Yo-API
- Loading branch information
Showing
1 changed file
with
21 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"; |