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
|
end
|
||||||
|
|
||||||
class CurlDownloadStrategy <AbstractDownloadStrategy
|
class CurlDownloadStrategy <AbstractDownloadStrategy
|
||||||
|
attr_reader :tarball_path
|
||||||
|
|
||||||
def initialize url, name, version, specs
|
def initialize url, name, version, specs
|
||||||
super
|
super
|
||||||
if @unique_token
|
if @unique_token
|
||||||
|
|||||||
@ -133,6 +133,10 @@ class Formula
|
|||||||
self.class.path name
|
self.class.path name
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def cached_download
|
||||||
|
@downloader.tarball_path
|
||||||
|
end
|
||||||
|
|
||||||
attr_reader :url, :version, :homepage, :name, :specs
|
attr_reader :url, :version, :homepage, :name, :specs
|
||||||
|
|
||||||
def bin; prefix+'bin' end
|
def bin; prefix+'bin' end
|
||||||
|
|||||||
9
bin/brew
9
bin/brew
@ -14,7 +14,14 @@ require 'global'
|
|||||||
|
|
||||||
case ARGV.first
|
case ARGV.first
|
||||||
when '--cache'
|
when '--cache'
|
||||||
puts HOMEBREW_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
|
exit 0
|
||||||
when '-h', '--help', '--usage', '-?', 'help', nil
|
when '-h', '--help', '--usage', '-?', 'help', nil
|
||||||
puts ARGV.usage
|
puts ARGV.usage
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user