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

Add a nice little progress bar while downloading binary #1694

Merged
merged 2 commits into from
Sep 4, 2016

Conversation

xzyfer
Copy link
Contributor

@xzyfer xzyfer commented Sep 1, 2016

Forked from #1649.

This PR adds a small ascii progress bar to the binary download.
Stalled installations make up a steady background noise of our
issues. It's my hope that by making the binary fetch more
transparent we can stem the tide of those issues.

In order to address @saper's concerns this progress bar will
respect npm's progress config flag.

sep-01-2016 21-33-35

Closes #1649

Forked from sass#1649.

This PR adds a small ascii progress bar to the binary download.
Stalled installations make up a steady background noise of our
issues. It's my hope that by making the binary fetch more
transparent we can stem the tide of those issues.

In order to address @saper's [concerns][1] this progress bar will
respect npm's `progress` config flag.

Downloading
```
Start downloading binary at https://github.com/sass/node-sass/releases/download/v3.8.0/darwin-x64-48_binding.node
Total 2602136 [===============          ] 1566256 60% 4.9s
```
Success
```
Start downloading binary at https://github.com/sass/node-sass/releases/download/v3.8.0/darwin-x64-48_binding.node
Total 2602136 [=========================] 2602136 100% 0.0s
Binary downloaded and installed at /tmp/node-sass/vendor/darwin-x64-48/binding.node
```

[1]: sass#1649 (comment)
@xzyfer
Copy link
Contributor Author

xzyfer commented Sep 1, 2016

@nschonni taking your advice I've replaced the progress module with npmlog.

@@ -56,6 +57,8 @@ function download(url, dest, cb) {
}
};

console.log('Start downloading binary at', url);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was the console.log intentional? Not sure if the log.newGroup makes sense here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it was. The user wont get any progress output until we get a response which won't happen for things like connection timeouts.

Tracker groups not appear to produce any output. I could be wrong, the docs aren't useful.

@xzyfer xzyfer modified the milestones: next.minor, next.patch Sep 4, 2016
@xzyfer xzyfer merged commit ba3a2e0 into sass:master Sep 4, 2016
@xzyfer xzyfer deleted the feat/progress-bar branch September 4, 2016 04:23
@xzyfer
Copy link
Contributor Author

xzyfer commented Sep 4, 2016

Happy to iterate on this. For now I want to get 3.9.0 out before tagging the next libsass.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants