diff --git a/src/cmd/flash.js b/src/cmd/flash.js index 3504946d1..eed32a97a 100644 --- a/src/cmd/flash.js +++ b/src/cmd/flash.js @@ -117,7 +117,7 @@ module.exports = class FlashCommand extends CLICommandBase { skipReset }); await qdl.run(); - fs.appendFileSync(outputLog, 'OS Download complete.'); + fs.appendFileSync(outputLog, `OS Download complete.${os.EOL}`); } catch (error) { fs.appendFileSync(outputLog, 'Download failed with error: ' + error.message); throw new Error('Download failed with error: ' + error.message); @@ -137,7 +137,7 @@ module.exports = class FlashCommand extends CLICommandBase { }); await qdl.run(); - fs.appendFileSync(output, 'Config file download complete.'); + fs.appendFileSync(output, `Config file download complete.${os.EOL}`); } catch (error) { fs.appendFileSync(output, 'Download failed with error: ' + error.message); throw new Error('Download failed with error: ' + error.message); diff --git a/src/lib/qdl.js b/src/lib/qdl.js index 9b8915819..c6e815880 100644 --- a/src/lib/qdl.js +++ b/src/lib/qdl.js @@ -28,6 +28,7 @@ class QdlFlasher { } async run() { + let qdlProcess; try { const qdlPath = await this.getExecutable(); const qdlArguments = this.buildArgs({ files: this.files, includeDir: this.includeDir, zip: this.zip }); @@ -35,7 +36,7 @@ class QdlFlasher { const command = `${qdlPath} ${qdlArguments.join(' ')}`; fs.appendFileSync(this.outputLogFile, `Command: ${command}\n`); - const qdlProcess = execa(qdlPath, qdlArguments, { + qdlProcess = execa(qdlPath, qdlArguments, { cwd: this.updateFolder || process.cwd(), stdio: 'pipe' }); @@ -56,6 +57,9 @@ class QdlFlasher { if (this.progressBarInitialized) { this.progressBar.stop(); } + if (qdlProcess && qdlProcess.kill) { + qdlProcess.kill(); + } } }