diff options
| author | Vinoth Ramiah | 2016-09-16 19:15:31 +0100 |
|---|---|---|
| committer | Vinoth Ramiah | 2016-10-19 14:59:57 +0100 |
| commit | 154237ba8eea0be4d6b6a25b67cced4a4fecda9d (patch) | |
| tree | 4208e9f5df22ea2736fb74f8a9326f0746e7d11c /Library/Homebrew/cask/lib/hbc/cli/info.rb | |
| parent | b9fe36abdc5f1898be3f7884086bee5674ee0528 (diff) | |
| download | brew-154237ba8eea0be4d6b6a25b67cced4a4fecda9d.tar.bz2 | |
fix 'cask info' for external repos with numbers
fixes 2 issues: error when username has a number, correct url for repos not on github
Diffstat (limited to 'Library/Homebrew/cask/lib/hbc/cli/info.rb')
| -rw-r--r-- | Library/Homebrew/cask/lib/hbc/cli/info.rb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Library/Homebrew/cask/lib/hbc/cli/info.rb b/Library/Homebrew/cask/lib/hbc/cli/info.rb index 0957ba4fd..be6feb63b 100644 --- a/Library/Homebrew/cask/lib/hbc/cli/info.rb +++ b/Library/Homebrew/cask/lib/hbc/cli/info.rb @@ -20,7 +20,7 @@ module Hbc puts "#{cask.token}: #{cask.version}" puts Formatter.url(cask.homepage) if cask.homepage installation_info(cask) - puts "From: #{Formatter.url(github_info(cask))}" if github_info(cask) + puts "From: #{Formatter.url(repo_info(cask))}" if repo_info(cask) name_info(cask) artifact_info(cask) Installer.print_caveats(cask) @@ -50,9 +50,11 @@ module Hbc puts cask.name.empty? ? Formatter.error("None") : cask.name end - def self.github_info(cask) + def self.repo_info(cask) user, repo, token = QualifiedToken.parse(Hbc.all_tokens.detect { |t| t.split("/").last == cask.token }) - "#{Tap.fetch(user, repo).default_remote}/blob/master/Casks/#{token}.rb" + remote_tap = Tap.fetch(user, repo) + return "#{remote_tap.remote}" if remote_tap.custom_remote? + "#{remote_tap.default_remote}/blob/master/Casks/#{token}.rb" end def self.artifact_info(cask) |
