File tree 1 file changed +16
-11
lines changed
1 file changed +16
-11
lines changed Original file line number Diff line number Diff line change @@ -321,18 +321,23 @@ export async function stopRecordingScreen (
321
321
this . log . debug ( 'No video data is found. Returning an empty string' ) ;
322
322
return '' ;
323
323
}
324
- if ( _ . isEmpty ( remotePath ) ) {
325
- const { size} = await fs . stat ( videoPath ) ;
326
- this . log . debug ( `The size of the resulting screen recording is ${ util . toReadableSizeString ( size ) } ` ) ;
324
+
325
+ try {
326
+ if ( _ . isEmpty ( remotePath ) ) {
327
+ const { size} = await fs . stat ( videoPath ) ;
328
+ this . log . debug ( `The size of the resulting screen recording is ${ util . toReadableSizeString ( size ) } ` ) ;
329
+ }
330
+ return await uploadRecordedMedia ( videoPath , remotePath , {
331
+ user,
332
+ pass,
333
+ method,
334
+ headers,
335
+ fileFieldName,
336
+ formFields,
337
+ } ) ;
338
+ } finally {
339
+ await fs . rimraf ( videoPath ) ;
327
340
}
328
- return await uploadRecordedMedia ( videoPath , remotePath , {
329
- user,
330
- pass,
331
- method,
332
- headers,
333
- fileFieldName,
334
- formFields,
335
- } ) ;
336
341
}
337
342
338
343
/**
You can’t perform that action at this time.
0 commit comments