Skip to content
This repository has been archived by the owner on Feb 24, 2024. It is now read-only.

Commit

Permalink
feat: show progress in bootstrap download
Browse files Browse the repository at this point in the history
  • Loading branch information
neko-para committed Aug 22, 2023
1 parent b9dd0aa commit 6107717
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions scripts/bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ async function downloadTo(url, path) {
}).then(response => {
return new Promise((resolve, reject) => {
response.data.pipe(writer)
const length = response.headers['content-length']
let current = 0
response.data.on('data', chunk => {
current += chunk.length
process.stdout.write(`${current} / ${length} \r`)
})
let error = null
writer.on('error', err => {
error = err
Expand Down

0 comments on commit 6107717

Please sign in to comment.