brew --cache [formula]
This developer-oriented command lets you ask Homebrew what the cached filename will be for a brew's tarball.
This commit is contained in:
parent
1149b082bb
commit
080a7ee3dc
@ -53,6 +53,8 @@ class AbstractDownloadStrategy
|
||||
end
|
||||
|
||||
class CurlDownloadStrategy <AbstractDownloadStrategy
|
||||
attr_reader :tarball_path
|
||||
|
||||
def initialize url, name, version, specs
|
||||
super
|
||||
if @unique_token
|
||||
|
||||
@ -133,6 +133,10 @@ class Formula
|
||||
self.class.path name
|
||||
end
|
||||
|
||||
def cached_download
|
||||
@downloader.tarball_path
|
||||
end
|
||||
|
||||
attr_reader :url, :version, :homepage, :name, :specs
|
||||
|
||||
def bin; prefix+'bin' end
|
||||
|
||||
7
bin/brew
7
bin/brew
@ -14,7 +14,14 @@ require 'global'
|
||||
|
||||
case ARGV.first
|
||||
when '--cache'
|
||||
if ARGV.named.empty?
|
||||
puts HOMEBREW_CACHE
|
||||
else
|
||||
require 'formula'
|
||||
ARGV.named.each do |name|
|
||||
puts Formula.factory(name).cached_download rescue '(built from source control)'
|
||||
end
|
||||
end
|
||||
exit 0
|
||||
when '-h', '--help', '--usage', '-?', 'help', nil
|
||||
puts ARGV.usage
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user