@@ -189,7 +189,7 @@ async function runHttpDiscovery(modulePath: string): Promise<DiscoveryResult> {
189
189
190
190
async function runFileDiscovery ( modulePath : string ) : Promise < DiscoveryResult > {
191
191
const outputPath = path . join ( os . tmpdir ( ) , `firebase-functions-test-${ Date . now ( ) } .json` ) ;
192
-
192
+
193
193
return new Promise ( ( resolve , reject ) => {
194
194
const proc = subprocess . spawn ( "npx" , [ "firebase-functions" ] , {
195
195
cwd : path . resolve ( modulePath ) ,
@@ -213,19 +213,21 @@ async function runFileDiscovery(modulePath: string): Promise<DiscoveryResult> {
213
213
214
214
proc . on ( "close" , async ( code ) => {
215
215
clearTimeout ( timeoutId ) ;
216
-
216
+
217
217
if ( code === 0 ) {
218
218
try {
219
219
const manifestJson = await fs . readFile ( outputPath , "utf8" ) ;
220
220
const manifest = JSON . parse ( manifestJson ) as Record < string , unknown > ;
221
- await fs . unlink ( outputPath ) . catch ( ( ) => { } ) ;
221
+ await fs . unlink ( outputPath ) . catch ( ( ) => {
222
+ // Ignore errors
223
+ } ) ;
222
224
resolve ( { success : true , manifest } ) ;
223
225
} catch ( e ) {
224
226
resolve ( { success : false , error : `Failed to read manifest file: ${ e } ` } ) ;
225
227
}
226
228
} else {
227
- const errorLines = stderr . split ( '\n' ) . filter ( line => line . trim ( ) ) ;
228
- const errorMessage = errorLines . join ( ' ' ) || "No error message found" ;
229
+ const errorLines = stderr . split ( "\n" ) . filter ( ( line ) => line . trim ( ) ) ;
230
+ const errorMessage = errorLines . join ( " " ) || "No error message found" ;
229
231
resolve ( { success : false , error : errorMessage } ) ;
230
232
}
231
233
} ) ;
0 commit comments