aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cask/lib
diff options
context:
space:
mode:
authorMarkus Reiter2016-10-06 15:51:30 +0200
committerGitHub2016-10-06 15:51:30 +0200
commitfaebc6481585bf352572c36ccec5e68a6fb037eb (patch)
tree375bb705b4b41d82659ca9c6c86e78535596b9b5 /Library/Homebrew/cask/lib
parent7e70ebd4f188e59172decc3a74aa61fbb4b58655 (diff)
parent108d0761eed42c0e7800b0d59a9948b45eb57def (diff)
downloadbrew-faebc6481585bf352572c36ccec5e68a6fb037eb.tar.bz2
Merge pull request #1216 from reitermarkus/fix-language-audit
Fix exit code for multilingual cask audit.
Diffstat (limited to 'Library/Homebrew/cask/lib')
-rw-r--r--Library/Homebrew/cask/lib/hbc/auditor.rb20
1 files changed, 11 insertions, 9 deletions
diff --git a/Library/Homebrew/cask/lib/hbc/auditor.rb b/Library/Homebrew/cask/lib/hbc/auditor.rb
index ee1b50938..d6846080b 100644
--- a/Library/Homebrew/cask/lib/hbc/auditor.rb
+++ b/Library/Homebrew/cask/lib/hbc/auditor.rb
@@ -1,20 +1,22 @@
module Hbc
class Auditor
def self.audit(cask, audit_download: false, check_token_conflicts: false)
- saved_languages = MacOS.instance_variable_get(:@languages)
-
if languages_blocks = cask.instance_variable_get(:@dsl).instance_variable_get(:@language_blocks)
- languages_blocks.keys.each do |languages|
- ohai "Auditing language: #{languages.map { |lang| "'#{lang}'" }.join(", ")}"
- MacOS.instance_variable_set(:@languages, languages)
- audit_cask_instance(Hbc.load(cask.sourcefile_path), audit_download, check_token_conflicts)
- CLI::Cleanup.run(cask.token) if audit_download
+ 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)
+ }.all?
+ ensure
+ MacOS.instance_variable_set(:@languages, saved_languages)
end
else
audit_cask_instance(cask, audit_download, check_token_conflicts)
end
- ensure
- MacOS.instance_variable_set(:@languages, saved_languages)
end
def self.audit_cask_instance(cask, audit_download, check_token_conflicts)