1- import * as _glob from 'glob' ;
1+ import * as fg from 'fast- glob' ;
22import { workspaceRoot } from 'nx/src/utils/app-root' ;
33import { join } from 'path' ;
44
55const globOptions = {
66 cwd : workspaceRoot ,
7+ ignore : [ '**/bin/**' , '**/obj/**' ] ,
78} ;
89
910/**
10- * Wraps the glob package in a promise api .
11+ * Wraps the fast- glob package.
1112 * @returns array of file paths
1213 */
1314export function glob ( path : string , cwd ?: string ) : Promise < string [ ] > {
14- return new Promise ( ( resolve , reject ) =>
15- _glob (
16- path ,
17- ! cwd ? globOptions : { cwd : join ( workspaceRoot , cwd ) } ,
18- ( err , matches ) => ( err ? reject ( ) : resolve ( matches ) ) ,
19- ) ,
15+ return fg (
16+ path ,
17+ ! cwd ? globOptions : { ...globOptions , cwd : join ( workspaceRoot , cwd ) } ,
2018 ) ;
2119}
2220
@@ -40,7 +38,7 @@ export function findProjectFileInPath(path: string): Promise<string> {
4038}
4139
4240export function findProjectFileInPathSync ( path : string ) : string {
43- const results = _glob . sync ( `${ path } /**/*.*proj` , globOptions ) ;
41+ const results = fg . sync ( `${ path } /**/*.*proj` , globOptions ) ;
4442 if ( ! results || results . length === 0 ) {
4543 throw new Error (
4644 "Unable to find a build-able project within project's source directory!" ,
0 commit comments