mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
33 lines
939 B
Ruby
33 lines
939 B
Ruby
# frozen_string_literal: true
|
|
|
|
module Cask
|
|
class Cmd
|
|
class Audit < AbstractCommand
|
|
option "--download", :download, false
|
|
option "--appcast", :appcast, false
|
|
option "--token-conflicts", :token_conflicts, false
|
|
|
|
def self.help
|
|
"verifies installability of Casks"
|
|
end
|
|
|
|
def run
|
|
failed_casks = casks(alternative: -> { Cask.to_a })
|
|
.reject { |cask| audit(cask) }
|
|
|
|
return if failed_casks.empty?
|
|
|
|
raise CaskError, "audit failed for casks: #{failed_casks.join(" ")}"
|
|
end
|
|
|
|
def audit(cask)
|
|
odebug "Auditing Cask #{cask}"
|
|
Auditor.audit(cask, audit_download: download?,
|
|
audit_appcast: appcast?,
|
|
check_token_conflicts: token_conflicts?,
|
|
quarantine: quarantine?)
|
|
end
|
|
end
|
|
end
|
|
end
|