UNPKG

wedge-cli

Version:

weex for tv

55 lines (47 loc) 2.14 kB
#!/usr/bin/env node var fs = require("fs"), Promise = require('bluebird'); var path = require('path'); var program = require('commander'); var pkg = require('../package.json'); var yo = require('../lib/yo.js'); cli(); function cli() { var self = this; return new Promise(function (resolve) { program .version(pkg.version) program .command('init') .alias('i') .description('initiate a new Wedge project') .action(function () { yo('generator-wedge',[],function () { console.log('create success'); }); }); program .command('package') .alias('p') .description('build ypp for tv, based on JDK') .option('-p, --password [password]', '签名密码') .option('-k, --keystore [keystore]', '签名p12文文件') .option('-a, --anothername [anothername]', 'PrivateKey and Certificate\'s alias in end keystore') .option('-t, --signtype [signtype]', '0:作者签名, 1:供应商签名1, 2:供应商签名2···') .option('-d, --debug', '使用debug签名(其他参数可以忽略)') .action(function () { // rm('-rf', path.join(process.cwd(), './buildLocal')) // var manifest = require(path.join(process.cwd(), './src/manifest.json')) // var wpk = path.join(process.cwd(), './buildLocal/'+(manifest.package || manifest.domain.name)+'.wpk') require('../lib/sign.js')('','','','',true); // if((this.password && this.keystore && this.anothername && this.signtype) || this.debug){ // //exec('wedge package') // require('../lib/sign.js')(this.keystore, this.password, this.anothername, this.signtype, this.debug); // }else{ // console.log('[ Moye Error ] 请追加签名所需参数,wedge p -h查看所需参数') // } }); program.parse(process.argv); resolve(program); }) }