Skip to content

Commit

Permalink
fix(cli): eta format
Browse files Browse the repository at this point in the history
  • Loading branch information
ido-pluto committed Sep 23, 2024
1 parent 66d2d59 commit ef29d55
Showing 1 changed file with 6 additions and 24 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import chalk from "chalk";
import {SummaryMultiProgressBar} from "../multiProgressBars/SummaryMultiProgressBar.js";
import {DataLine, renderDataLine} from "../../utils/data-line.js";
import {renderDataLine} from "../../utils/data-line.js";
import FancyTransferCliProgressBar from "./fancy-transfer-cli-progress-bar.js";
import {STATUS_ICONS} from "../../utils/progressBarIcons.js";
import {DownloadFlags} from "../../../download-engine/download-file/progress-status-file.js";
Expand Down Expand Up @@ -50,9 +50,9 @@ export default class SummaryTransferCliProgressBar extends FancyTransferCliProgr
}

protected renderDownloadSequence(): string {
const {formatTransferredOfTotal, formattedSpeed, formatTimeLeft, comment, formattedPercentage} = this.status;
const {formatTransferredOfTotal, formattedSpeed, comment, formattedPercentage} = this.status;
const progressBar = `(${formatTransferredOfTotal})`;
const dataLine: DataLine = [
return renderDataLine([
{
type: "status",
fullText: "",
Expand Down Expand Up @@ -105,26 +105,8 @@ export default class SummaryTransferCliProgressBar extends FancyTransferCliProgr
type: "speed",
fullText: formattedSpeed,
size: formattedSpeed.length
}
];

if (this.showETA) {
dataLine.push(
{
type: "spacer",
fullText: " | ",
size: " | ".length,
formatter: (text) => chalk.dim(text)
},
{
type: "timeLeft",
fullText: formatTimeLeft,
size: formatTimeLeft.length,
formatter: (text) => text
}
);
}

return renderDataLine(dataLine);
},
...this.getETA(" | ")
]);
}
}

0 comments on commit ef29d55

Please sign in to comment.