Skip to content

Instantly share code, notes, and snippets.

@sh19910711
Last active January 2, 2016 22:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sh19910711/8368303 to your computer and use it in GitHub Desktop.
Save sh19910711/8368303 to your computer and use it in GitHub Desktop.
path = require 'path'
yeoman = require 'yeoman-generator'
module.exports = class TestGenerator extends yeoman.generators.Base
constructor: (args, options, config) ->
yeoman.generators.Base.apply this, arguments
@on 'end', ->
@installDependencies skipInstall: options['skip-install']
@pkg = JSON.parse @readFileAsString path.join __dirname, '../package.json'
askFor: ->
cb = @async()
# have Yeoman greet the user.
console.log @yeoman
prompts = [
type: 'confirm'
name: 'someOption'
message: 'Would you like to enable this option? This is just a test'
default: true
]
@prompt prompts, (props) =>
@someOption = props.someOption
cb()
app: ->
@mkdir 'app'
@mkdir 'app/templates'
@copy '_package.json', 'package.json'
@copy '_bower.json', 'bower.json'
projectfiles: ->
@copy 'editorconfig', '.editorconfig'
@copy 'jshintrc', '.jshintrc'
require('coffee-script');
module.exports = require('./index.coffee');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment