From cead924c444651f1cd6d328ef26024707bc669d6 Mon Sep 17 00:00:00 2001 From: keeramis Date: Mon, 3 Feb 2025 16:07:49 -0800 Subject: [PATCH] Modify progress bar output --- src/cmd/flash.js | 8 +++++--- src/cmd/setup-tachyon.js | 2 +- src/lib/qdl.js | 5 +++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/cmd/flash.js b/src/cmd/flash.js index eed32a97a..0e72f7d48 100644 --- a/src/cmd/flash.js +++ b/src/cmd/flash.js @@ -105,7 +105,7 @@ module.exports = class FlashCommand extends CLICommandBase { try { if (verbose) { - this.ui.write(`Starting download. See logs at: ${outputLog}${os.EOL}`); + this.ui.write(`${os.EOL}Starting download. See logs at: ${outputLog}${os.EOL}`); } const qdl = new QdlFlasher({ files: filesToProgram, @@ -114,7 +114,8 @@ module.exports = class FlashCommand extends CLICommandBase { zip: zipFile, ui: this.ui, outputLogFile: outputLog, - skipReset + skipReset, + currTask: 'OS' }); await qdl.run(); fs.appendFileSync(outputLog, `OS Download complete.${os.EOL}`); @@ -133,7 +134,8 @@ module.exports = class FlashCommand extends CLICommandBase { const qdl = new QdlFlasher({ files: [firehoseFile, xmlFile], ui: this.ui, - outputLogFile: output + outputLogFile: output, + currTask: 'Configuration file' }); await qdl.run(); diff --git a/src/cmd/setup-tachyon.js b/src/cmd/setup-tachyon.js index e52c65cf5..d5e941f46 100644 --- a/src/cmd/setup-tachyon.js +++ b/src/cmd/setup-tachyon.js @@ -578,7 +578,7 @@ Welcome to the Particle Tachyon setup! This interactive command: const outputLog = path.join(process.cwd(), `tachyon_flash_${Date.now()}.log`); fs.ensureFileSync(outputLog); - this.ui.write(`Starting download. See logs at: ${outputLog}${os.EOL}`); + this.ui.write(`${os.EOL}Starting download. See logs at: ${outputLog}${os.EOL}`); if (!skipFlashingOs) { await flashCommand.flashTachyon({ files: [packagePath], skipReset: true, output: outputLog, verbose: false }); } diff --git a/src/lib/qdl.js b/src/lib/qdl.js index c6e815880..c15b0388c 100644 --- a/src/lib/qdl.js +++ b/src/lib/qdl.js @@ -10,7 +10,7 @@ const mkdirTemp = util.promisify(temp.mkdir); const TACHYON_STORAGE_TYPE = 'ufs'; class QdlFlasher { - constructor({ files, includeDir, updateFolder, zip, ui, outputLogFile, skipReset=false }) { + constructor({ files, includeDir, updateFolder, zip, ui, outputLogFile, skipReset=false, currTask=null }) { this.files = files; this.includeDir = includeDir; this.updateFolder = updateFolder; @@ -25,6 +25,7 @@ class QdlFlasher { this.progressBarInitialized = false; this.preparingDownload = false; this.skipReset = skipReset; + this.currTask = currTask; } async run() { @@ -160,7 +161,7 @@ class QdlFlasher { } if (this.totalSectorsFlashed === this.totalSectorsInAllFiles) { - this.progressBar.update({ description: 'Flashing complete' }); + this.progressBar.update({ description: `Flashing complete ${this.currTask} ? ${this.currTask} : ''` }); } } }