File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change 1
1
/* eslint-disable require-atomic-updates */
2
2
3
3
import assert from 'assert' ;
4
+ import { existsSync } from 'fs' ;
4
5
import fs from 'fs/promises' ;
5
6
import path from 'path' ;
6
7
import { builtinModules } from 'module' ;
@@ -194,7 +195,22 @@ function upon(p: string, base: string) {
194
195
}
195
196
196
197
function collect ( ps : string [ ] ) {
197
- return globSync ( ps , { absolute : true , dot : true } ) ;
198
+ const patterns : string [ ] = [ ] ;
199
+ const paths : string [ ] = [ ] ;
200
+
201
+ for ( const pattern of ps ) {
202
+ if ( isDynamicPattern ( pattern ) ) {
203
+ patterns . push ( pattern ) ;
204
+ } else if ( existsSync ( pattern ) ) {
205
+ paths . push ( pattern ) ;
206
+ }
207
+ }
208
+
209
+ if ( globPatterns . length !== 0 ) {
210
+ return [ ...paths , ...globSync ( patterns , { absolute : true , dot : true } ) ] ;
211
+ }
212
+
213
+ return paths ;
198
214
}
199
215
200
216
function expandFiles ( efs : string | string [ ] , base : string ) {
You can’t perform that action at this time.
0 commit comments