aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorJack Nagel2014-02-22 20:17:04 -0500
committerJack Nagel2014-02-22 20:17:04 -0500
commita836602024146c8f1bf849a068c94f7023bd0f13 (patch)
tree9c408dfc5a0d4121c73bfe7299d79c0b6a19df01 /Library
parentd1dd4b0e6792beec55b714ddb4e2aacb8b86d948 (diff)
downloadbrew-a836602024146c8f1bf849a068c94f7023bd0f13.tar.bz2
create: make conditional more obvious
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/cmd/create.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/Library/Homebrew/cmd/create.rb b/Library/Homebrew/cmd/create.rb
index 9d749d73e..04ebe5d2e 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