@@ -20,7 +20,7 @@ import * as semver from 'semver';
2020import { getNpmPackageJson } from './npm' ;
2121import { NpmRepositoryPackageJson } from './npm-package-json' ;
2222import { Dependency , JsonSchemaForNpmPackageJsonFiles } from './package-json' ;
23- import { UpdateSchema } from './schema' ;
23+ import { Schema as UpdateSchema } from './schema' ;
2424
2525type VersionRange = string & { __VERSION_RANGE : void ; } ;
2626type PeerVersionTransform = string | ( ( range : string ) => string ) ;
@@ -758,9 +758,11 @@ export default function(options: UpdateSchema): Rule {
758758 // We cannot just return this because we need to fetch the packages from NPM still for the
759759 // help/guide to show.
760760 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 [ ] ) ;
764766 }
765767
766768 if ( options . migrateOnly && options . from ) {
@@ -852,9 +854,9 @@ export default function(options: UpdateSchema): Rule {
852854 logger . createChild ( '' ) ,
853855 'warn' ,
854856 ) ;
855- _validateUpdatePackages ( infoMap , options . force , sublog ) ;
857+ _validateUpdatePackages ( infoMap , ! ! options . force , sublog ) ;
856858
857- return _performUpdate ( tree , context , infoMap , logger , options . migrateOnly ) ;
859+ return _performUpdate ( tree , context , infoMap , logger , ! ! options . migrateOnly ) ;
858860 } else {
859861 return _usageMessage ( options , infoMap , logger ) ;
860862 }
0 commit comments