diff options
| author | Jack Nagel | 2015-05-28 23:57:02 -0400 |
|---|---|---|
| committer | Jack Nagel | 2015-05-28 23:57:02 -0400 |
| commit | 5cb392d9d7cf05022be5f3eac121cffb1fe7b097 (patch) | |
| tree | c615d20183bd27b0a9d819daa549404e0648d08a /Library/Homebrew/cmd/bottle.rb | |
| parent | 0abe16673eaf49d3f83754b806f4b4c31d0db642 (diff) | |
| download | brew-5cb392d9d7cf05022be5f3eac121cffb1fe7b097.tar.bz2 | |
Revert "Check empty? to avoid introducing nils"
This reverts commit 580cd173cbf92aa9851e68d635af518a668a6cdc.
Diffstat (limited to 'Library/Homebrew/cmd/bottle.rb')
| -rw-r--r-- | Library/Homebrew/cmd/bottle.rb | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/Library/Homebrew/cmd/bottle.rb b/Library/Homebrew/cmd/bottle.rb index 9c01c968f..ba397c59e 100644 --- a/Library/Homebrew/cmd/bottle.rb +++ b/Library/Homebrew/cmd/bottle.rb @@ -125,17 +125,14 @@ module Homebrew return ofail "Formula has no stable version: #{f.name}" end - bottle_revision = 0 - - unless ARGV.include? "--no-revision" + if ARGV.include? '--no-revision' + bottle_revision = 0 + else ohai "Determining #{f.name} bottle revision..." versions = FormulaVersions.new(f) bottle_revisions = versions.bottle_version_map("origin/master")[f.pkg_version] - - unless bottle_revisions.empty? - bottle_revisions.pop if bottle_revisions.last > 0 - bottle_revision = bottle_revisions.max + 1 - end + bottle_revisions.pop if bottle_revisions.last.to_i > 0 + bottle_revision = bottle_revisions.any? ? bottle_revisions.max.to_i + 1 : 0 end filename = Bottle::Filename.create(f, bottle_tag, bottle_revision) |
