UNPKG

generator-cg-angular

Version:

Yeoman Generator for Enterprise Angular projects.

45 lines (29 loc) 1.05 kB
'use strict'; var util = require('util'); var yeoman = require('yeoman-generator'); var path = require('path'); var cgUtils = require('../utils.js'); var chalk = require('chalk'); var _ = require('underscore'); var fs = require('fs'); _.str = require('underscore.string'); _.mixin(_.str.exports()); var FilterGenerator = module.exports = function FilterGenerator(args, options, config) { cgUtils.getNameArg(this,args); yeoman.generators.Base.apply(this, arguments); }; util.inherits(FilterGenerator, yeoman.generators.Base); FilterGenerator.prototype.askFor = function askFor() { var cb = this.async(); var prompts = []; cgUtils.addNamePrompt(this,prompts,'filter'); this.prompt(prompts, function (props) { if (props.name){ this.name = props.name; } cgUtils.askForModuleAndDir('filter',this,false,cb); }.bind(this)); }; FilterGenerator.prototype.files = function files() { cgUtils.processTemplates(this.name,this.dir,'filter',this,null,null,this.module); };