From 9eaf221885c6340ce5a737b54d8d6bb652c197bb Mon Sep 17 00:00:00 2001 From: Markus Reiter Date: Tue, 11 Oct 2016 15:10:12 +0200 Subject: [PATCH] Allow auditing of a single language of a cask. --- Library/Homebrew/cask/lib/hbc/auditor.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Library/Homebrew/cask/lib/hbc/auditor.rb b/Library/Homebrew/cask/lib/hbc/auditor.rb index d6846080bd..b112fd0ed7 100644 --- a/Library/Homebrew/cask/lib/hbc/auditor.rb +++ b/Library/Homebrew/cask/lib/hbc/auditor.rb @@ -1,15 +1,16 @@ module Hbc class Auditor def self.audit(cask, audit_download: false, check_token_conflicts: false) - if languages_blocks = cask.instance_variable_get(:@dsl).instance_variable_get(:@language_blocks) + if !ARGV.value("language") && + languages_blocks = cask.instance_variable_get(:@dsl).instance_variable_get(:@language_blocks) begin saved_languages = MacOS.instance_variable_get(:@languages) languages_blocks.keys.map { |languages| ohai "Auditing language: #{languages.map { |lang| "'#{lang}'" }.join(", ")}" MacOS.instance_variable_set(:@languages, languages) - CLI::Cleanup.run(cask.token) if audit_download audit_cask_instance(Hbc.load(cask.sourcefile_path), audit_download, check_token_conflicts) + CLI::Cleanup.run(cask.token) if audit_download }.all? ensure MacOS.instance_variable_set(:@languages, saved_languages)