Last active
January 2, 2016 22:09
-
-
Save sh19910711/8368303 to your computer and use it in GitHub Desktop.
yeoman + coffeescript https://github.com/tuxracer/generator-generatorcs
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
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' |
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
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