Exemplo n.º 1
0
 choices: function () {
   return fs
     .getModulePackInfo(module)
     .get('wbp_init_projects')
     .then(function (projects) {
       return projects && projects.map(function (project) {
         return project.name
       })
     })
 }
Exemplo n.º 2
0
 return Promise.try(function () {
   var packageModule = fs.getModule(package_abs_path);
   if (packageModule) {
     return fs
       .getModulePackInfo(packageModule)
       .get('dependencies')
       .then(function (deps) {
         return (deps && deps[pkg]);
       });
   }
   throw package_abs_path + ' can not be resolved!';
 })
Exemplo n.º 3
0
module.exports = function main(params, options) {
  context = cx = this;

  //invoke the dev-tool specified by user.
  if (params && params.length) {
    var devtool = params[0];
    return context.call('dev-' + devtool);
  }

  //invoke the dev-tool based on the project type created by initialization process.
  return fs
    .getModulePackInfo(module)
    .get('wbp')
    .get('project')
    .then(function (project) {
      if (project) return cx.call('dev-' + project);
      throw "don't know what type of this project is.";
    });
}