text: 'use strict';
  const yeoman = require('yeoman-generator');
  const chalk = require('chalk');
  const yosay = require('yosay');
  
  module.exports = yeoman.extend({
  
    constructor: function (args, opts) {
      yeoman.apply(this, arguments);
      this.argument('moduleName', {
        desc: 'A name of the new page',
        type: String,
        required: false
      });
    },
  
    prompting: function () {
      const prompts = [{
        type: 'input',
        name: 'moduleName',
        message: 'What is tha name of the new page?',
        when: typeof this.options.moduleName === 'undefined'
      }];
  
      return this.prompt(prompts).then(function (props) {
        // To access props later use this.props.someAnswer;
        this.props = props;
        this.moduleName = this.props.moduleName;
      }.bind(this));
    },
  
    writing: function () {
      let baseName;
  
      if (typeof this.options.moduleName === 'undefined') {
        baseName = this.props.moduleName;
  
      } else {
        baseName = this.options.moduleName;
      }
  
      const ejsName = baseName + '.ejs';
      const scssName = '_' + baseName + '.scss';
      const camelName = baseName.replace(/-([a-z])/g, (g) => { return g[1].toUpperCase(); });
      const fName = camelName.charAt(0).toUpperCase() + camelName.substring(1);
  
      this.fs.copyTpl(
        this.templatePath('template.ejs'),
        this.destinationPath(ejsName),
        { name:baseName, end:'%>' }
      );
  
      this.fs.copyTpl(
        this.templatePath('_template.scss'),
        this.destinationPath(scssName),
        { name:baseName }
      );
    },
  
    install: function () {
      //this.installDependencies();
    }
  });
  