aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/utils.rb
diff options
context:
space:
mode:
authorJeppe Toustrup2017-02-25 11:09:57 +0000
committerJeppe Toustrup2017-02-25 11:30:46 +0000
commitebaf3cdc6a8cf637ec8f8b8a7e289a8d0dfd8f88 (patch)
treee5da0f3084c87eebcc3d74a9cce05b6621f1eafc /Library/Homebrew/utils.rb
parent9a0116d5c4967441a6c85656ef7f15795cd02bbc (diff)
downloadbrew-ebaf3cdc6a8cf637ec8f8b8a7e289a8d0dfd8f88.tar.bz2
Add 'B' for bytes to cleanup command output
When `brew cleanup` is run it prints out a message like the following: > This operation has freed approximately 222M of disk space. The '222M' refers to megabytes but the normal acronym for megabytes would be 'MB'. The 'B' is also missing from kilobytes and gigabytes in the output, so that's what this commit adds.
Diffstat (limited to 'Library/Homebrew/utils.rb')
-rw-r--r--Library/Homebrew/utils.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/Library/Homebrew/utils.rb b/Library/Homebrew/utils.rb
index b129c7328..56ddfd611 100644
--- a/Library/Homebrew/utils.rb
+++ b/Library/Homebrew/utils.rb
@@ -422,13 +422,13 @@ end
def disk_usage_readable(size_in_bytes)
if size_in_bytes >= 1_073_741_824
size = size_in_bytes.to_f / 1_073_741_824
- unit = "G"
+ unit = "GB"
elsif size_in_bytes >= 1_048_576
size = size_in_bytes.to_f / 1_048_576
- unit = "M"
+ unit = "MB"
elsif size_in_bytes >= 1_024
size = size_in_bytes.to_f / 1_024
- unit = "K"
+ unit = "KB"
else
size = size_in_bytes
unit = "B"