create: make conditional more obvious
This commit is contained in:
parent
d1dd4b0e67
commit
a836602024
@ -95,6 +95,10 @@ class FormulaCreator
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def fetch?
|
||||||
|
!ARGV.include?("--no-fetch")
|
||||||
|
end
|
||||||
|
|
||||||
def generate!
|
def generate!
|
||||||
raise "#{path} already exists" if path.exist?
|
raise "#{path} already exists" if path.exist?
|
||||||
|
|
||||||
@ -103,8 +107,7 @@ class FormulaCreator
|
|||||||
puts "You'll need to add an explicit 'version' to the formula."
|
puts "You'll need to add an explicit 'version' to the formula."
|
||||||
end
|
end
|
||||||
|
|
||||||
# XXX: why is "and version" here?
|
if fetch? && version
|
||||||
unless ARGV.include? "--no-fetch" and version
|
|
||||||
r = Resource.new
|
r = Resource.new
|
||||||
r.url, r.version, r.owner = url, version, self
|
r.url, r.version, r.owner = url, version, self
|
||||||
@sha1 = r.fetch.sha1 if r.download_strategy == CurlDownloadStrategy
|
@sha1 = r.fetch.sha1 if r.download_strategy == CurlDownloadStrategy
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user