diff options
| author | Martin Schimandl | 2017-10-07 21:32:40 +0200 |
|---|---|---|
| committer | Martin Schimandl | 2017-11-10 20:16:38 +0100 |
| commit | ff2239509d53f86ca48330ddfc6f24fe03ba9768 (patch) | |
| tree | d974cd7012b87eff3ab52c30e2796846f5bec590 /Library/Homebrew/cask/lib | |
| parent | be68f3d7b49f2e9b84e7230d5c22b6522992ea8c (diff) | |
| download | brew-ff2239509d53f86ca48330ddfc6f24fe03ba9768.tar.bz2 | |
Change behaviour of 'cask _stanza' command. Add tests for 'cask _stanza' command
Diffstat (limited to 'Library/Homebrew/cask/lib')
| -rw-r--r-- | Library/Homebrew/cask/lib/hbc/cli/internal_stanza.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Library/Homebrew/cask/lib/hbc/cli/internal_stanza.rb b/Library/Homebrew/cask/lib/hbc/cli/internal_stanza.rb index b0812d27c..411170010 100644 --- a/Library/Homebrew/cask/lib/hbc/cli/internal_stanza.rb +++ b/Library/Homebrew/cask/lib/hbc/cli/internal_stanza.rb @@ -71,10 +71,16 @@ module Hbc next end + if value == nil || (value.kind_of?(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 artifact_name && !value.key?(artifact_name) opoo "no such stanza '#{artifact_name}' on Cask '#{cask}'" unless quiet? puts "" - next + raise ArgumentError, "no such stanza '#{artifact_name}' on Cask '#{cask}'" end if stanza == :artifacts |
