-
Notifications
You must be signed in to change notification settings - Fork 910
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(GH-363) Show human-readable file sizes when downloading #404
Conversation
ElseIf ($size -gt 1KB) {[string]::Format("{0:0.00} kB", $size / 1KB)} | ||
ElseIf ($size -gt 0) {[string]::Format("{0:0.00} B", $size)} | ||
Else {""} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this file require attribution? If you pulled this off of the internet, it will require at the very least linking back to the source.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If not, it should include this header:
# Copyright © 2011 - Present RealDimensions Software, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
#
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I stole the function from SO. Instead of getting the attribution right, I rewrote it in a simpler way.
Thanks for the contribution! If you can see above on fixes I have suggested and fix that up. 👍 |
Also your commit message could use a body to help understand what is going on. It can be short, but I would appreciate a little more information about what is being added and why versus the status quo. I imagine you have already seen the CONTRIBUTING.md guide on formatting your commit messages (as this contribution is already in line with those standards). |
When downloading files, show the download progress like 'Saving 8.5 MB of 8.82 MB (8911368/9252864)' instead of 'Saving 8911368 of 9252864'. Adds Format-FileSize helper function to format the file sizes like mentioned above.
(GH-363) Show human-readable file sizes when downloading
This will be included in 0.9.10. |
Closes #363