diff options
| author | Markus Reiter | 2016-09-12 06:18:55 +0200 |
|---|---|---|
| committer | Markus Reiter | 2016-09-12 06:21:16 +0200 |
| commit | 3b6d80913a36d7db64aa3aa11766c6ee72b0aa29 (patch) | |
| tree | 22ef40d1560af15d30f027282eab4a2d488a29fa | |
| parent | 2b45ae483199d846b84fea4826b2a20fe74d1dbe (diff) | |
| download | brew-3b6d80913a36d7db64aa3aa11766c6ee72b0aa29.tar.bz2 | |
Fix cask installation from untapped Tap not working.
| -rw-r--r-- | Library/Homebrew/cask/lib/hbc/source/tapped_qualified.rb | 14 | ||||
| -rw-r--r-- | Library/Homebrew/cask/lib/hbc/source/untapped_qualified.rb | 9 |
2 files changed, 16 insertions, 7 deletions
diff --git a/Library/Homebrew/cask/lib/hbc/source/tapped_qualified.rb b/Library/Homebrew/cask/lib/hbc/source/tapped_qualified.rb index 48f8501e5..1da013db2 100644 --- a/Library/Homebrew/cask/lib/hbc/source/tapped_qualified.rb +++ b/Library/Homebrew/cask/lib/hbc/source/tapped_qualified.rb @@ -2,11 +2,21 @@ require "hbc/source/tapped" class Hbc::Source::TappedQualified < Hbc::Source::Tapped def self.me?(query) - !Hbc::QualifiedToken.parse(query).nil? && path_for_query(query).exist? + return if (tap = tap_for_query(query)).nil? + + tap.installed? && path_for_query(query).exist? + end + + def self.tap_for_query(query) + qualified_token = Hbc::QualifiedToken.parse(query) + return if qualified_token.nil? + + user, repo, token = qualified_token + Tap.fetch(user, repo) end def self.path_for_query(query) user, repo, token = Hbc::QualifiedToken.parse(query) - Tap.new(user, repo).cask_dir.join(token.sub(%r{(\.rb)?$}i, ".rb")) + Tap.fetch(user, repo).cask_dir.join(token.sub(%r{(\.rb)?$}i, ".rb")) end end diff --git a/Library/Homebrew/cask/lib/hbc/source/untapped_qualified.rb b/Library/Homebrew/cask/lib/hbc/source/untapped_qualified.rb index 361919bb3..7188d34ce 100644 --- a/Library/Homebrew/cask/lib/hbc/source/untapped_qualified.rb +++ b/Library/Homebrew/cask/lib/hbc/source/untapped_qualified.rb @@ -1,11 +1,10 @@ require "hbc/source/tapped_qualified" class Hbc::Source::UntappedQualified < Hbc::Source::TappedQualified - def self.path_for_query(query) - user, repo, token = Hbc::QualifiedToken.parse(query) + def self.me?(query) + return if (tap = tap_for_query(query)).nil? - tap = Tap.fetch(user, repo) - tap.install unless tap.installed? - tap.cask_dir.join(token.sub(%r{(\.rb)?$}i, ".rb")) + tap.install + tap.installed? && path_for_query(query).exist? end end |
