diff --git a/Library/Homebrew/cmd/create.rb b/Library/Homebrew/cmd/create.rb index 9d749d73e19162d391c5d814080d2def8e194dc6..04ebe5d2eaf38bf22d5cce0ba63ff67cd4ea15a5 100644 --- a/Library/Homebrew/cmd/create.rb +++ b/Library/Homebrew/cmd/create.rb @@ -95,6 +95,10 @@ class FormulaCreator end end + def fetch? + !ARGV.include?("--no-fetch") + end + def generate! 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." end - # XXX: why is "and version" here? - unless ARGV.include? "--no-fetch" and version + if fetch? && version r = Resource.new r.url, r.version, r.owner = url, version, self @sha1 = r.fetch.sha1 if r.download_strategy == CurlDownloadStrategy