MCPcopy Create free account
hub / github.com/ampproject/amphtml / logProgress_

Function logProgress_

build-system/release-workflows/upload-release.js:84–102  ·  view source on GitHub ↗

* Logs file processing progress every 1 second. * * @param {number} totalFiles * @param {number} processedFiles

(totalFiles, processedFiles)

Source from the content-addressed store, hash-verified

82 * @param {number} processedFiles
83 */
84function logProgress_(totalFiles, processedFiles) {
85 const percentage = Math.round((processedFiles / totalFiles) * PROGRESS_WIDTH);
86 if (printProgressReady || processedFiles === totalFiles) {
87 log(
88 '[' +
89 '#'.repeat(percentage) +
90 '.'.repeat(PROGRESS_WIDTH - percentage) +
91 ']',
92 cyan(processedFiles),
93 '/',
94 cyan(totalFiles)
95 );
96
97 printProgressReady = false;
98 setTimeout(() => {
99 printProgressReady = true;
100 }, 1000);
101 }
102}
103
104/**
105 * Compresses a single file with Brotli and writes it to ${path}.br.

Callers 2

brotliCompressAll_Function · 0.85
uploadFiles_Function · 0.85

Calls 2

cyanFunction · 0.85
logFunction · 0.50

Tested by

no test coverage detected