Commands should not have side-effects
Don't install when bottling. Homebrew should bottle whatever is installed. If nothing is installed, error out.
This commit is contained in:
parent
924f92300f
commit
1576e0a537
@ -1,18 +1,20 @@
|
|||||||
# Builds binary brew package
|
# Builds binary brew package
|
||||||
require 'cmd/install'
|
require 'cmd/install'
|
||||||
|
|
||||||
Homebrew.install_formulae ARGV.formulae
|
|
||||||
|
|
||||||
destination = HOMEBREW_PREFIX + "Bottles"
|
destination = HOMEBREW_PREFIX + "Bottles"
|
||||||
if not File.directory?(destination)
|
Dir.mkdir destination unless File.directory? destination
|
||||||
Dir.mkdir destination
|
|
||||||
end
|
|
||||||
|
|
||||||
ARGV.each do|formula|
|
ARGV.each do|formula|
|
||||||
# Get the latest version
|
# Get the latest version
|
||||||
version = `brew list --versions #{formula}`.split.last
|
version = `brew list --versions #{formula}`.split.last
|
||||||
|
|
||||||
|
if version.nil?
|
||||||
|
onoe "Formula not installed: #{formula}"
|
||||||
|
next
|
||||||
|
end
|
||||||
|
|
||||||
source = HOMEBREW_CELLAR + formula + version
|
source = HOMEBREW_CELLAR + formula + version
|
||||||
filename = formula + '-' + version + '-bottle.tar.gz'
|
filename = "#{formula}-#{version}-bottle.tar.gz"
|
||||||
ohai "Bottling #{formula} #{version}..."
|
ohai "Bottling #{formula} #{version}..."
|
||||||
HOMEBREW_CELLAR.cd do
|
HOMEBREW_CELLAR.cd do
|
||||||
# Use gzip, faster to compress than bzip2, faster to uncompress than bzip2
|
# Use gzip, faster to compress than bzip2, faster to uncompress than bzip2
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user