Skip to content

fix: Delete screen recording after serving. #300

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 16 additions & 11 deletions lib/commands/record-screen.js
Original file line number Diff line number Diff line change
@@ -321,18 +321,23 @@ export async function stopRecordingScreen (
this.log.debug('No video data is found. Returning an empty string');
return '';
}
if (_.isEmpty(remotePath)) {
const {size} = await fs.stat(videoPath);
this.log.debug(`The size of the resulting screen recording is ${util.toReadableSizeString(size)}`);

try {
if (_.isEmpty(remotePath)) {
const {size} = await fs.stat(videoPath);
this.log.debug(`The size of the resulting screen recording is ${util.toReadableSizeString(size)}`);
}
return await uploadRecordedMedia(videoPath, remotePath, {
user,
pass,
method,
headers,
fileFieldName,
formFields,
});
} finally {
await fs.rimraf(videoPath);
}
return await uploadRecordedMedia(videoPath, remotePath, {
user,
pass,
method,
headers,
fileFieldName,
formFields,
});
}

/**