mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
Split appsupport out into function
This commit is contained in:
parent
7bb66cf93a
commit
d2c7fcac29
@ -29,6 +29,11 @@ def ohai title
|
|||||||
puts "\033[0;34m==>\033[0;0;1m #{title[0,n]}\033[0;0m"
|
puts "\033[0;34m==>\033[0;0;1m #{title[0,n]}\033[0;0m"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def appsupport
|
||||||
|
appsupport = File.expand_path "~/Library/Application Support/Homebrew"
|
||||||
|
FileUtils.mkpath appsupport unless File.exist? appsupport
|
||||||
|
return appsupport
|
||||||
|
end
|
||||||
|
|
||||||
class Formula
|
class Formula
|
||||||
require 'find'
|
require 'find'
|
||||||
@ -70,8 +75,6 @@ class Formula
|
|||||||
|
|
||||||
ohai "Downloading #{@url}"
|
ohai "Downloading #{@url}"
|
||||||
|
|
||||||
appsupport = File.expand_path "~/Library/Application Support/Homebrew"
|
|
||||||
FileUtils.mkpath appsupport unless File.exist? appsupport
|
|
||||||
Dir.chdir appsupport do
|
Dir.chdir appsupport do
|
||||||
tgz=Pathname.new(fetch()).realpath
|
tgz=Pathname.new(fetch()).realpath
|
||||||
md5=`md5 -q "#{tgz}"`.strip
|
md5=`md5 -q "#{tgz}"`.strip
|
||||||
|
Loading…
x
Reference in New Issue
Block a user