File tree Expand file tree Collapse file tree 2 files changed +9
-6
lines changed
workspace/src/command-line Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -63,12 +63,15 @@ function parseGenerateOpts(
6363 ) {
6464 throwInvalidInvocation ( ) ;
6565 }
66- [ collectionName , generatorName ] = ( generatorOptions [ '_' ] as string [ ] )
67- . shift ( )
68- . split ( ':' ) ;
69- if ( ! generatorName ) {
70- generatorName = collectionName ;
66+ const generatorDescriptor = ( generatorOptions [ '_' ] as string [ ] ) . shift ( ) ;
67+ const separatorIndex = generatorDescriptor . lastIndexOf ( ':' ) ;
68+
69+ if ( separatorIndex > 0 ) {
70+ collectionName = generatorDescriptor . substr ( 0 , separatorIndex ) ;
71+ generatorName = generatorDescriptor . substr ( separatorIndex + 1 ) ;
72+ } else {
7173 collectionName = defaultCollection ;
74+ generatorName = generatorDescriptor ;
7275 }
7376 } else {
7477 collectionName = generatorOptions . collection as string ;
Original file line number Diff line number Diff line change @@ -129,7 +129,7 @@ function constructCollection() {
129129 if ( exists ( path . join ( childDir , 'schema.json' ) ) ) {
130130 generators [ c ] = {
131131 factory : `./${ c } ` ,
132- schema : `./${ path . join ( c , 'schema.json' ) } ` ,
132+ schema : `./${ normalize ( path . join ( c , 'schema.json' ) ) } ` ,
133133 description : `Schematic ${ c } ` ,
134134 } ;
135135 }
You can’t perform that action at this time.
0 commit comments