aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cask
diff options
context:
space:
mode:
Diffstat (limited to 'Library/Homebrew/cask')
-rw-r--r--Library/Homebrew/cask/lib/hbc/cli/internal_stanza.rb18
1 files changed, 9 insertions, 9 deletions
diff --git a/Library/Homebrew/cask/lib/hbc/cli/internal_stanza.rb b/Library/Homebrew/cask/lib/hbc/cli/internal_stanza.rb
index 05d939a4b..4f8569444 100644
--- a/Library/Homebrew/cask/lib/hbc/cli/internal_stanza.rb
+++ b/Library/Homebrew/cask/lib/hbc/cli/internal_stanza.rb
@@ -71,16 +71,16 @@ module Hbc
next
end
- if value.nil? || (value.is_a?(Array) && value.empty?)
- opoo "no such stanza '#{stanza}' on Cask '#{cask}'" unless quiet?
- puts ""
- raise ArgumentError, "no such stanza '#{stanza}' on Cask '#{cask}'"
- end
+ if (value.nil? || value.is_a?(Array) && value.empty?) ||
+ (artifact_name && !value.key?(artifact_name))
- if artifact_name && !value.key?(artifact_name)
- opoo "no such stanza '#{artifact_name}' on Cask '#{cask}'" unless quiet?
- puts ""
- raise ArgumentError, "no such stanza '#{artifact_name}' on Cask '#{cask}'"
+ if artifact_name
+ thing = artifact_name
+ else
+ thing = stanza
+ end
+
+ raise CaskError, "no such stanza '#{thing}' on Cask '#{cask}'"
end
if stanza == :artifacts