Skip to content

Commit

Permalink
Modify progress bar output
Browse files Browse the repository at this point in the history
  • Loading branch information
keeramis committed Feb 4, 2025
1 parent 23f4796 commit cead924
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
8 changes: 5 additions & 3 deletions src/cmd/flash.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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}`);
Expand All @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/setup-tachyon.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
}
Expand Down
5 changes: 3 additions & 2 deletions src/lib/qdl.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -25,6 +25,7 @@ class QdlFlasher {
this.progressBarInitialized = false;
this.preparingDownload = false;
this.skipReset = skipReset;
this.currTask = currTask;
}

async run() {
Expand Down Expand Up @@ -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} : ''` });
}
}
}
Expand Down

0 comments on commit cead924

Please sign in to comment.