Created
August 25, 2013 20:54
-
-
Save tuxracer/6336244 to your computer and use it in GitHub Desktop.
yeoman index.js created by generator-generator. Compare to https://gist.github.com/tuxracer/6332601
This file contains hidden or 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
// yeoman index.js created by generator-generator. Compare to https://gist.github.com/tuxracer/6332601 | |
'use strict'; | |
var util = require('util'); | |
var path = require('path'); | |
var yeoman = require('yeoman-generator'); | |
var ChaplinGenerator = module.exports = function ChaplinGenerator(args, options, config) { | |
yeoman.generators.Base.apply(this, arguments); | |
this.on('end', function () { | |
this.installDependencies({ skipInstall: options['skip-install'] }); | |
}); | |
this.pkg = JSON.parse(this.readFileAsString(path.join(__dirname, '../package.json'))); | |
}; | |
util.inherits(ChaplinGenerator, yeoman.generators.Base); | |
ChaplinGenerator.prototype.askFor = function askFor() { | |
var cb = this.async(); | |
// have Yeoman greet the user. | |
console.log(this.yeoman); | |
var prompts = [{ | |
type: 'confirm', | |
name: 'someOption', | |
message: 'Would you like to enable this option?', | |
default: true | |
}]; | |
this.prompt(prompts, function (props) { | |
this.someOption = props.someOption; | |
cb(); | |
}.bind(this)); | |
}; | |
ChaplinGenerator.prototype.app = function app() { | |
this.mkdir('app'); | |
this.mkdir('app/templates'); | |
this.copy('_package.json', 'package.json'); | |
this.copy('_bower.json', 'bower.json'); | |
}; | |
ChaplinGenerator.prototype.projectfiles = function projectfiles() { | |
this.copy('editorconfig', '.editorconfig'); | |
this.copy('jshintrc', '.jshintrc'); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment