cask/info: fix installed size reporting
This commit is contained in:
parent
8f863199bc
commit
0799222df2
@ -42,16 +42,15 @@ module Cask
|
|||||||
return "Not installed" unless cask.installed?
|
return "Not installed" unless cask.installed?
|
||||||
|
|
||||||
versioned_staged_path = cask.caskroom_path.join(cask.installed_version)
|
versioned_staged_path = cask.caskroom_path.join(cask.installed_version)
|
||||||
path_details = if versioned_staged_path.exist?
|
|
||||||
versioned_staged_path.abv
|
return "Installed\n#{versioned_staged_path} (#{Formatter.error("does not exist")})\n" unless versioned_staged_path.exist?
|
||||||
else
|
|
||||||
Formatter.error("does not exist")
|
path_details = versioned_staged_path.children.sum(&:disk_usage)
|
||||||
end
|
|
||||||
|
|
||||||
tab = Tab.for_cask(cask)
|
tab = Tab.for_cask(cask)
|
||||||
|
|
||||||
info = ["Installed"]
|
info = ["Installed"]
|
||||||
info << "#{versioned_staged_path} (#{path_details})"
|
info << "#{versioned_staged_path} (#{disk_usage_readable(path_details)})"
|
||||||
info << " #{tab}" if tab.tabfile&.exist?
|
info << " #{tab}" if tab.tabfile&.exist?
|
||||||
info.join("\n")
|
info.join("\n")
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user