@@ -20,7 +20,7 @@ import * as semver from 'semver';
20
20
import { getNpmPackageJson } from './npm' ;
21
21
import { NpmRepositoryPackageJson } from './npm-package-json' ;
22
22
import { Dependency , JsonSchemaForNpmPackageJsonFiles } from './package-json' ;
23
- import { UpdateSchema } from './schema' ;
23
+ import { Schema as UpdateSchema } from './schema' ;
24
24
25
25
type VersionRange = string & { __VERSION_RANGE : void ; } ;
26
26
type PeerVersionTransform = string | ( ( range : string ) => string ) ;
@@ -758,9 +758,11 @@ export default function(options: UpdateSchema): Rule {
758
758
// We cannot just return this because we need to fetch the packages from NPM still for the
759
759
// help/guide to show.
760
760
options . packages = [ ] ;
761
- } else if ( typeof options . packages == 'string' ) {
762
- // If a string, then we should split it and make it an array.
763
- options . packages = options . packages . split ( / , / g) ;
761
+ } else {
762
+ // We split every packages by commas to allow people to pass in multiple and make it an array.
763
+ options . packages = options . packages . reduce ( ( acc , curr ) => {
764
+ return acc . concat ( curr . split ( ',' ) ) ;
765
+ } , [ ] as string [ ] ) ;
764
766
}
765
767
766
768
if ( options . migrateOnly && options . from ) {
@@ -852,9 +854,9 @@ export default function(options: UpdateSchema): Rule {
852
854
logger . createChild ( '' ) ,
853
855
'warn' ,
854
856
) ;
855
- _validateUpdatePackages ( infoMap , options . force , sublog ) ;
857
+ _validateUpdatePackages ( infoMap , ! ! options . force , sublog ) ;
856
858
857
- return _performUpdate ( tree , context , infoMap , logger , options . migrateOnly ) ;
859
+ return _performUpdate ( tree , context , infoMap , logger , ! ! options . migrateOnly ) ;
858
860
} else {
859
861
return _usageMessage ( options , infoMap , logger ) ;
860
862
}
0 commit comments