cask/cmd/info: fix brew style, refactor.
This commit is contained in:
parent
f96afdbf41
commit
12a0c281ea
@ -59,23 +59,19 @@ module Cask
|
|||||||
end
|
end
|
||||||
|
|
||||||
def self.installation_info(cask)
|
def self.installation_info(cask)
|
||||||
|
return "Not installed\n" unless cask.installed?
|
||||||
|
|
||||||
install_info = +""
|
install_info = +""
|
||||||
if cask.installed?
|
cask.versions.each do |version|
|
||||||
cask.versions.each do |version|
|
versioned_staged_path = cask.caskroom_path.join(version)
|
||||||
versioned_staged_path = cask.caskroom_path.join(version)
|
path_details = if versioned_staged_path.exist?
|
||||||
install_info << versioned_staged_path.to_s
|
versioned_staged_path.abv
|
||||||
.concat(" (")
|
else
|
||||||
.concat(
|
Formatter.error("does not exist")
|
||||||
if versioned_staged_path.exist?
|
|
||||||
then versioned_staged_path.abv
|
|
||||||
else Formatter.error("does not exist")
|
|
||||||
end,
|
|
||||||
).concat(")\n")
|
|
||||||
end
|
end
|
||||||
install_info.freeze
|
install_info << "#{versioned_staged_path} (#{path_details})\n"
|
||||||
else
|
|
||||||
"Not installed\n"
|
|
||||||
end
|
end
|
||||||
|
install_info.freeze
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.name_info(cask)
|
def self.name_info(cask)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user