diff --git a/src/main/ipc-handlers/schema.js b/src/main/ipc-handlers/schema.js index 04d4c7c7..c59d9e0f 100644 --- a/src/main/ipc-handlers/schema.js +++ b/src/main/ipc-handlers/schema.js @@ -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); }); diff --git a/src/main/libs/exporters/BaseExporter.js b/src/main/libs/exporters/BaseExporter.js index fa5ce605..cfeb7ea7 100644 --- a/src/main/libs/exporters/BaseExporter.js +++ b/src/main/libs/exporters/BaseExporter.js @@ -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); }