File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11#!/usr/bin/env node
2+ import * as fs from 'fs' ;
23import * as Path from 'path' ;
34import * as minimist from 'minimist' ;
45import { GeneratorFactory } from '../lib/config/GeneratorFactory' ;
@@ -36,7 +37,17 @@ if (args.help) {
3637 showHelp ( ) ;
3738} else {
3839 const packageRootDirectories = ( args . _ . length > 0 ? args . _ : [ '' ] )
39- . map ( path => Path . posix . join ( process . cwd ( ) , path ) ) ;
40+ . map ( path => Path . posix . join ( process . cwd ( ) , path ) )
41+ . flatMap ( path => {
42+ // Since path expansion does not work on Windows, we may receive wildcard paths, so let's expand those here
43+ if ( path . endsWith ( '*' ) ) {
44+ path = path . slice ( 0 , - 1 ) ;
45+ // eslint-disable-next-line no-sync
46+ return fs . readdirSync ( path )
47+ . map ( subFile => Path . posix . join ( path , subFile ) ) ;
48+ }
49+ return path ;
50+ } ) ;
4051 new GeneratorFactory ( { resolutionContext : new ResolutionContext ( ) } )
4152 . createGenerator ( process . cwd ( ) , args , packageRootDirectories )
4253 . then ( generator => generator . generateComponents ( ) )
You can’t perform that action at this time.
0 commit comments