File tree Expand file tree Collapse file tree 1 file changed +16
-11
lines changed
Expand file tree Collapse file tree 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 (
321321 this . log . debug ( 'No video data is found. Returning an empty string' ) ;
322322 return '' ;
323323 }
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 ) ;
327340 }
328- return await uploadRecordedMedia ( videoPath , remotePath , {
329- user,
330- pass,
331- method,
332- headers,
333- fileFieldName,
334- formFields,
335- } ) ;
336341}
337342
338343/**
You can’t perform that action at this time.
0 commit comments