function GeneratorProject(type) {
  var projectTypePath = path.join(__dirname, 'projects', type);
  var defaultProjectName = 'angularity-project';

  if (!fs.existsSync(projectTypePath)) {
    console.error('Error there does not seem to be a project with the name', type);
  }

  return {
    /**
     * The project type is the folder name of the generator project.
     * Eg: es5-minimal
     */
    projectType    : type,
    /**
     * The absolute path to the generator project template.
     */
    projectTypePath: projectTypePath,
    /**
     * The project name used by the generator to populate the config files, destination etc.
     */
    projectName    : defaultProjectName,
    /**
     * The absolute path the the generator project's template folder.
     */
    templatePath   : path.join(__dirname, 'projects', type, 'template'),
    /**
     * The generator project's destination path.
     */
    destination    : path.join(String(process.cwd()), defaultProjectName),

    projectConfig: configDefaults.projectConfig,

    /**
     * Set the main project name and update the destination path.
     * @param name
     */
    setProjectName: function (name) {
      this.projectName = name;
      this.destination = path.join(String(process.cwd()), name);
    },

    /**
     * Based on the current GeneratorProject object,
     * recursively copy all the project's files to the project's destination.
     */
    copyProjectTemplateFiles: function () {
      util.cpR(this.templatePath, this.destination, true);
    },

    /**
     * Based on the current GeneratorProject object,
     * create an Angularity Project Config and determine the destination automatically.
     * @param override
     */
    createAngularityProjectConfig: function (override) {
      if (typeof override !== 'undefined') {
        this.projectConfig = _.merge(this.projectConfig, override);
      }
      util.createAngularityProjectConfig(this.destination, this.projectConfig);
    }
  };
}
/**
 * The main Generator Project template.
 * @param type
 * @constructor
 */
The main Generator Project template.
@param type
@constructor
The main Generator Project template . @param type @constructor
function GeneratorProject(type) {
  var projectTypePath = path.join(__dirname, 'projects', type);
  var defaultProjectName = 'angularity-project';
  if (!fs.existsSync(projectTypePath)) {
    console.error('Error there does not seem to be a project with the name', type);
  }
  return {
    projectType    : type,
    projectTypePath: projectTypePath,
    projectName    : defaultProjectName,
    templatePath   : path.join(__dirname, 'projects', type, 'template'),
    destination    : path.join(String(process.cwd()), defaultProjectName),
    projectConfig: configDefaults.projectConfig,
    setProjectName: function (name) {
      this.projectName = name;
      this.destination = path.join(String(process.cwd()), name);
    },
    copyProjectTemplateFiles: function () {
      util.cpR(this.templatePath, this.destination, true);
    },
    createAngularityProjectConfig: function (override) {
      if (typeof override !== 'undefined') {
        this.projectConfig = _.merge(this.projectConfig, override);
      }
      util.createAngularityProjectConfig(this.destination, this.projectConfig);
    }
  };
}
function GeneratorProject ( type ) { var projectTypePath = path . join ( __dirname , 'projects' , type ) ; var defaultProjectName = 'angularity-project' ; if ( ! fs . existsSync ( projectTypePath ) ) { console . error ( 'Error there does not seem to be a project with the name' , type ) ; } return { projectType : type , projectTypePath : projectTypePath , projectName : defaultProjectName , templatePath : path . join ( __dirname , 'projects' , type , 'template' ) , destination : path . join ( String ( process . cwd ( ) ) , defaultProjectName ) , projectConfig : configDefaults . projectConfig , setProjectName : function ( name ) { this . projectName = name ; this . destination = path . join ( String ( process . cwd ( ) ) , name ) ; } , copyProjectTemplateFiles : function ( ) { util . cpR ( this . templatePath , this . destination , true ) ; } , createAngularityProjectConfig : function ( override ) { if ( typeof override !== 'undefined' ) { this . projectConfig = _ . merge ( this . projectConfig , override ) ; } util . createAngularityProjectConfig ( this . destination , this . projectConfig ) ; } } ; }
The main Generator Project template.
The main Generator Project template .
/**
     * The project type is the folder name of the generator project.
     * Eg: es5-minimal
     */ /**
     * The absolute path to the generator project template.
     */ /**
     * The project name used by the generator to populate the config files, destination etc.
     */ /**
     * The absolute path the the generator project's template folder.
     */ /**
     * The generator project's destination path.
     */ /**
     * Set the main project name and update the destination path.
     * @param name
     */ /**
     * Based on the current GeneratorProject object,
     * recursively copy all the project's files to the project's destination.
     */ /**
     * Based on the current GeneratorProject object,
     * create an Angularity Project Config and determine the destination automatically.
     * @param override
     */