Raise an error on download failure

This commit is contained in:
Max Howell 2009-05-21 04:36:53 +01:00
parent acc2f79696
commit 85bcf8b9e5

View File

@ -101,7 +101,10 @@ class Formula
protected protected
def fetch def fetch
tgz=File.expand_path File.basename(@url) tgz=File.expand_path File.basename(@url)
`curl -LOA "#{$agent}" "#{@url}"` unless File.exists? tgz unless File.exists? tgz
`curl -LOA "#{$agent}" "#{@url}"`
raise "Download failed" unless $? == 0
end
return tgz return tgz
end end