UNPKG

generator-mycroftx-component

Version:

Yeoman generator and modified generator-ng-component

34 lines (28 loc) 819 B
'use strict'; var path = require('path'); var yeoman = require('yeoman-generator'); var util = require('util'); var ngUtil = require('../util'); var ScriptBase = require('../script-base.js'); var Generator = module.exports = function Generator() { ScriptBase.apply(this, arguments); }; util.inherits(Generator, ScriptBase); Generator.prototype.askFor = function askFor() { var self = this; var done = this.async(); var prompts = [ { name: 'dir', message: 'Where would you like to create this service?', default: self.config.get('serviceDirectory') } ]; this.prompt(prompts, function (props) { this.dir = path.join(props.dir, this.name); done(); }.bind(this)); }; Generator.prototype.createFiles = function createFiles() { ngUtil.copyTemplates(this, 'service'); };