File tree Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -10,8 +10,18 @@ var mysql = require('mysql');
1010var Promise = require ( "bluebird" ) ;
1111var yargs = require ( 'yargs' )
1212 . usage ( 'Usage: $0 <command> [options]' )
13- . command ( 'init' , '初始化数据库' )
14- . command ( 'upgrade' , '升级数据库' )
13+ . command ( 'init' , '初始化数据库' , {
14+ dbpassword : {
15+ alias : 'dbpassword' ,
16+ type : 'string'
17+ }
18+ } )
19+ . command ( 'upgrade' , '升级数据库' , {
20+ dbpassword : {
21+ alias : 'dbpassword' ,
22+ type : 'string'
23+ }
24+ } )
1525 . example ( '$0 init --dbname codepush --dbhost localhost --dbuser root --dbpassword 123456 --dbport 3306 --force' , '初始化code-push-server数据库' )
1626 . example ( '$0 upgrade --dbname codepush --dbhost localhost --dbuser root --dbpassword 123456 --dbport 3306' , '升级code-push-server数据库' )
1727 . default ( { dbname : 'codepush' , dbhost : 'localhost' , dbuser : 'root' , dbpassword : null } )
@@ -24,9 +34,6 @@ var dbhost = argv.dbhost ? argv.dbhost : 'localhost';
2434var dbuser = argv . dbuser ? argv . dbuser : 'root' ;
2535var dbport = argv . dbport ? argv . dbport : 3306 ;
2636var dbpassword = null ;
27- if ( _ . isString ( argv . dbpassword ) || _ . isNumber ( argv . dbpassword ) ) {
28- dbpassword = argv . dbpassword ;
29- }
3037
3138if ( command === 'init' ) {
3239 var connection2 ;
You can’t perform that action at this time.
0 commit comments