Skip to content

Commit

Permalink
minor clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
keeramis committed Feb 3, 2025
1 parent a728fb5 commit 23f4796
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/cmd/flash.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down
6 changes: 5 additions & 1 deletion src/lib/qdl.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,15 @@ 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 });
this.progressBar = this.ui.createProgressBar();
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'
});
Expand All @@ -56,6 +57,9 @@ class QdlFlasher {
if (this.progressBarInitialized) {
this.progressBar.stop();
}
if (qdlProcess && qdlProcess.kill) {
qdlProcess.kill();
}
}
}

Expand Down

0 comments on commit 23f4796

Please sign in to comment.