Merge pull request #4343 from commitay/cask-info-updates
cask info: display `auto_updates`
This commit is contained in:
commit
43bfbe2060
@ -18,7 +18,7 @@ module Hbc
|
||||
end
|
||||
|
||||
def self.info(cask)
|
||||
puts "#{cask.token}: #{cask.version}"
|
||||
title_info(cask)
|
||||
puts Formatter.url(cask.homepage) if cask.homepage
|
||||
installation_info(cask)
|
||||
repo_info(cask)
|
||||
@ -28,6 +28,12 @@ module Hbc
|
||||
Installer.print_caveats(cask)
|
||||
end
|
||||
|
||||
def self.title_info(cask)
|
||||
title = "#{cask.token}: #{cask.version}"
|
||||
title += " (auto_updates)" if cask.auto_updates
|
||||
puts title
|
||||
end
|
||||
|
||||
def self.formatted_url(url)
|
||||
"#{Tty.underline}#{url}#{Tty.reset}"
|
||||
end
|
||||
|
||||
@ -26,6 +26,7 @@ module Hbc
|
||||
return
|
||||
end
|
||||
|
||||
ohai "Casks with `auto_updates` or `version :latest` will not be upgraded" if args.empty?
|
||||
oh1 "Upgrading #{Formatter.pluralize(outdated_casks.length, "outdated package")}, with result:"
|
||||
puts outdated_casks.map { |f| "#{f.full_name} #{f.version}" } * ", "
|
||||
|
||||
|
||||
@ -20,6 +20,21 @@ describe Hbc::CLI::Info, :cask do
|
||||
EOS
|
||||
end
|
||||
|
||||
it "it prints auto_updates if the Cask has `auto_updates true`" do
|
||||
expect {
|
||||
described_class.run("with-auto-updates")
|
||||
}.to output(<<~EOS).to_stdout
|
||||
with-auto-updates: 1.0 (auto_updates)
|
||||
http://example.com/autoupdates
|
||||
Not installed
|
||||
From: https://github.com/Homebrew/homebrew-cask/blob/master/Casks/with-auto-updates.rb
|
||||
==> Name
|
||||
AutoUpdates
|
||||
==> Artifacts
|
||||
AutoUpdates.app (App)
|
||||
EOS
|
||||
end
|
||||
|
||||
describe "given multiple Casks" do
|
||||
let(:expected_output) {
|
||||
<<~EOS
|
||||
|
||||
@ -0,0 +1,12 @@
|
||||
cask 'with-auto-updates' do
|
||||
version '1.0'
|
||||
sha256 'e5be907a51cd0d5b128532284afe1c913608c584936a5e55d94c75a9f48c4322'
|
||||
|
||||
url "https://example.com/autoupdates_#{version}.zip"
|
||||
name 'AutoUpdates'
|
||||
homepage 'http://example.com/autoupdates'
|
||||
|
||||
auto_updates true
|
||||
|
||||
app 'AutoUpdates.app'
|
||||
end
|
||||
Loading…
x
Reference in New Issue
Block a user