我使用指挥官创建了一个小程序来生成一个小的应用程序模式。
我使用 ncp 将我的文件复制到新目录中,该目录运行良好,该软件包仅用于全局安装,没有其他模块依赖于此。问题是我最后一次下载了 4730,但我只下载了 2 或 3 次。
var program = require('commander')
, pkg = require('../package.json')
, version = pkg.version
, create_project = require('./create_project')
, create_bundle = require('./create_bundle')
, create_entities = require('./create_entities')
;
// commander
program
.version(version)
.option('-f, --force', 'force on non-empty directory')
program
.command('create:project <name>')
.description('create a new project')
.action(function(name){
create_project.do(name);
})
;
program
.command('create:bundle <name>')
.description('create a new bundle in your project')
.action(function(name){
create_bundle.do(name);
})
;
program
.command('create:database')
.description('create the database --- note : you need first to update your config/db.js file')
.action(function(){
create_entities.database();
})
;
program
.command('entity:update <name>')
.description('update entity <name> ')
.action(function(name){
create_entities.do(name);
})
;
program.parse(process.argv);