MCPcopy
hub / github.com/MiniMax-AI/cli / createProgressBar

Function createProgressBar

src/output/progress.ts:46–66  ·  view source on GitHub ↗
(total: number, label = '')

Source from the content-addressed store, hash-verified

44}
45
46export function createProgressBar(total: number, label = ''): ProgressBar {
47 const isTTY = process.stderr.isTTY;
48 const width = 30;
49
50 return {
51 update(current: number) {
52 if (!isTTY) return;
53 const pct = Math.min(1, current / total);
54 const filled = Math.round(width * pct);
55 const empty = width - filled;
56 const bar = '█'.repeat(filled) + '░'.repeat(empty);
57 const pctStr = `${Math.round(pct * 100)}%`;
58 process.stderr.write(`\r${label} ${bar} ${pctStr}`);
59 },
60 finish() {
61 if (isTTY) {
62 process.stderr.write('\n');
63 }
64 },
65 };
66}

Callers 1

downloadFileFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected