feat: delete dump file when the export is canceled

This commit is contained in:
Giulio Ganci 2021-11-04 23:09:28 +01:00
parent 8cf738bac8
commit d25c62b4da
2 changed files with 8 additions and 0 deletions

View File

@ -210,6 +210,10 @@ export default connections => {
resolve({ cancelled: exporter.isCancelled });
});
exporter.once('cancel', () => {
fs.unlinkSync(exporter.outputFile);
});
exporter.on('progress', state => {
event.sender.send('export-progress', state);
});

View File

@ -38,6 +38,10 @@ export class BaseExporter extends EventEmitter {
return this._isCancelled;
}
get outputFile () {
return this._options.outputFile;
}
outputFileExists () {
return fs.existsSync(this._options.outputFile);
}