@@ -9,10 +9,6 @@ import * as spawnAsyncModule from "@expo/spawn-async";
99
1010const spawnAsync = spawnAsyncModule . default || spawnAsyncModule ;
1111
12- import * as globModule from "fast-glob" ;
13-
14- const glob = globModule . default || globModule ;
15-
1612import * as path from "node:path" ;
1713import { pipeline } from "node:stream/promises" ;
1814import * as fs from "fs-extra" ;
@@ -174,15 +170,41 @@ export async function extractAppFromLocalArchiveAsync(
174170 ) ;
175171}
176172
173+ /**
174+ * Recursively finds files with a specific extension
175+ *
176+ * @param {string } dir - Directory to search in
177+ * @param {string } extension - File extension to search for
178+ * @returns {Promise<string[]> } - Array of relative file paths
179+ */
180+ async function findFilesByExtension ( dir : string , extension : string ) : Promise < string [ ] > {
181+ const results : string [ ] = [ ] ;
182+
183+ async function searchRecursively ( currentDir : string , relativePath = '' ) : Promise < void > {
184+ const entries = await fs . readdir ( currentDir , { withFileTypes : true } ) ;
185+
186+ for ( const entry of entries ) {
187+ const fullPath = path . join ( currentDir , entry . name ) ;
188+ const relPath = path . join ( relativePath , entry . name ) ;
189+
190+ if ( entry . isDirectory ( ) ) {
191+ await searchRecursively ( fullPath , relPath ) ;
192+ } else if ( entry . isFile ( ) && fullPath . endsWith ( `.${ extension } ` ) ) {
193+ results . push ( relPath ) ;
194+ }
195+ }
196+ }
197+
198+ await searchRecursively ( dir ) ;
199+ return results ;
200+ }
201+
177202async function getAppPathAsync (
178203 outputDir : string ,
179204 applicationExtension : string ,
180205) : Promise < string > {
181206 logger . startSpinner ( `Locating ${ applicationExtension } file` ) ;
182- const appFilePaths = await glob ( `./**/*.${ applicationExtension } ` , {
183- cwd : outputDir ,
184- onlyFiles : false ,
185- } ) ;
207+ const appFilePaths = await findFilesByExtension ( outputDir , applicationExtension ) ;
186208 if ( appFilePaths . length === 0 ) {
187209 logger . failSpinner ( "Search failed" ) ;
188210 throw Error ( "Did not find any installable apps inside tarball." ) ;
0 commit comments