From 9a69301e70eb387b8b02b0ffc384565368c19d82 Mon Sep 17 00:00:00 2001 From: keeramis Date: Thu, 16 Jan 2025 10:28:32 -0800 Subject: [PATCH] minor - rename functions in qdl --- src/cmd/flash.js | 3 +-- src/lib/qdl.js | 8 ++++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/cmd/flash.js b/src/cmd/flash.js index e98d012f3..a64717c38 100644 --- a/src/cmd/flash.js +++ b/src/cmd/flash.js @@ -107,7 +107,6 @@ module.exports = class FlashCommand extends CLICommandBase { } const outputLog = path.join(output ? output : process.cwd(), `tachyon_flash_${Date.now()}.log`); try { - // put the output in a log file if not verbose this.ui.write(`Logs are being written to: ${outputLog}${os.EOL}`); const qdl = new QdlFlasher({ files: filesToProgram, @@ -121,7 +120,7 @@ module.exports = class FlashCommand extends CLICommandBase { fs.appendFileSync(outputLog, 'Download complete.'); } catch (error) { this.ui.write('Download failed'); - fs.appendFileSync(outputLog, 'Download failed.'); + fs.appendFileSync(outputLog, 'Download failed with error: ' + error.message); } } diff --git a/src/lib/qdl.js b/src/lib/qdl.js index d7ff01c4c..b9fa38358 100644 --- a/src/lib/qdl.js +++ b/src/lib/qdl.js @@ -103,9 +103,9 @@ class QdlFlasher { if (line.includes('status=getProgramInfo')) { this.handleProgramInfo(line); } else if (line.includes('status=Start flashing module')) { - this.handleStartFlashingModule(line); + this.handleModuleStart(line); } else if (line.includes('status=Flashing module')) { - this.handleFlashingModule(line); + this.handleModuleProgress(line); } } @@ -120,7 +120,7 @@ class QdlFlasher { } } - handleStartFlashingModule(line) { + handleModuleStart(line) { const moduleNameMatch = line.match(/module=(.*?),/); const sectorsTotalMatch = line.match(/sectors_total=(\d+)/); if (moduleNameMatch && sectorsTotalMatch) { @@ -140,7 +140,7 @@ class QdlFlasher { } } - handleFlashingModule(line) { + handleModuleProgress(line) { const sectorsFlashedMatch = line.match(/sectors_done=(\d+)/); if (sectorsFlashedMatch) { const sectorsFlashed = parseInt(sectorsFlashedMatch[1], 10);