Skip to content

Commit

Permalink
fix: process.stdout.clearLine is not a function
Browse files Browse the repository at this point in the history
  • Loading branch information
charlypa committed Oct 31, 2023
1 parent f583d0d commit fa8aec0
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src-build/downloadNodeBinary.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,14 @@ async function downloadNodeBinary(platform, arch, maxRetries = 3) {
});

str.on('progress', progress => {
process.stdout.clearLine(0);
process.stdout.cursorTo(0);
if (process.stdout.isTTY) {
process.stdout.clearLine(0);
process.stdout.cursorTo(0);
}
process.stdout.write(`Downloading... ${Math.round(progress.percentage)}%`);
if (!process.stdout.isTTY) {
process.stdout.write('\n');
}
});

data.pipe(str).pipe(writer);
Expand Down

0 comments on commit fa8aec0

Please sign in to comment.