Skip to content
This repository was archived by the owner on Dec 2, 2020. It is now read-only.

Commit d4336cf

Browse files
committed
Merge pull request #65 from boxen/custom-boxen-download-urls
Allow a non-s3 source for homebrew packages
2 parents 7cd080c + a2cb6a1 commit d4336cf

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

files/boxen-bottle-hooks.rb

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,15 @@ def self.file(formula)
1515
def self.url(formula)
1616
os = MacOS.version
1717
file = self.file(formula)
18-
host = ENV['BOXEN_S3_HOST'] || 's3.amazonaws.com'
19-
bucket = ENV['BOXEN_S3_BUCKET'] || 'boxen-downloads'
18+
path = "/homebrew/#{os}/#{file}"
2019

21-
"http://#{bucket}.#{host}/homebrew/#{os}/#{file}"
20+
if ENV['BOXEN_DOWNLOAD_BASE_URL']
21+
ENV['BOXEN_DOWNLOAD_BASE_URL'] + path
22+
else
23+
host = ENV['BOXEN_S3_HOST'] || 's3.amazonaws.com'
24+
bucket = ENV['BOXEN_S3_BUCKET'] || 'boxen-downloads'
25+
"http://#{bucket}.#{host}" + path
26+
end
2227
end
2328

2429
def self.bottled?(formula)

0 commit comments

Comments
 (0)