@@ -16,23 +16,24 @@ module.exports = function updateCommand(api, opts) {
1616 description : 'update package.json' ,
1717 usage : 'micro-app update [options]' ,
1818 options : {
19- '-' : 'update all.' ,
19+ '--all ' : 'update all.' ,
2020 '--name <name>' : 'only update <name>.' ,
2121 } ,
2222 details : `
2323Examples:
2424 ${ chalk . gray ( '# update all' ) }
25- micro-app update
25+ micro-app update --all
2626 ${ chalk . gray ( '# only update <name>' ) }
27- micro-app update -n <name>
27+ micro-app update --name <name>
2828 ` . trim ( ) ,
2929 } , args => {
3030 const name = args . name ;
31- return updateMicro ( api , name ) ;
31+ const isAll = args . all ;
32+ return updateMicro ( api , name , isAll ) ;
3233 } ) ;
3334} ;
3435
35- function updateMicro ( api , name ) {
36+ function updateMicro ( api , name , isAll ) {
3637 const logger = api . logger ;
3738 const microAppConfig = api . selfConfig ;
3839 const micros = api . micros ;
@@ -64,7 +65,7 @@ function updateMicro(api, name) {
6465 }
6566 }
6667 }
67- } else if ( ! _name ) { // all
68+ } else if ( isAll ) { // all
6869 const gitPaths = _micros . map ( key => {
6970 const microConfig = microsConfig [ key ] ;
7071 if ( microConfig ) {
@@ -97,7 +98,7 @@ function updateMicro(api, name) {
9798 }
9899
99100 logger . logo ( `${ chalk . green ( 'Finish!' ) } ` ) ;
100- } else {
101+ } else if ( _name ) {
101102 logger . error ( '[update]' , `Not Found micros: "${ _name } "` ) ;
102103 }
103104
0 commit comments