aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/dev-cmd/create.rb
diff options
context:
space:
mode:
authorMike McQuaid2017-02-26 20:48:36 +0000
committerMike McQuaid2017-02-26 20:48:36 +0000
commitc2a460ec6d857ba33c89174d8d93fcaa403c3717 (patch)
tree089045fec4c46fb74e3b48868e2b335497df7b84 /Library/Homebrew/dev-cmd/create.rb
parentd3ae1cc264dc9eb9b602dd6aa21c4282dc049c79 (diff)
parentff93e1624b214c9b48731174a9135789fc3695a8 (diff)
downloadbrew-c2a460ec6d857ba33c89174d8d93fcaa403c3717.tar.bz2
Merge branch 'master' into filter_all_env_vars_932
Diffstat (limited to 'Library/Homebrew/dev-cmd/create.rb')
-rw-r--r--Library/Homebrew/dev-cmd/create.rb9
1 files changed, 3 insertions, 6 deletions
diff --git a/Library/Homebrew/dev-cmd/create.rb b/Library/Homebrew/dev-cmd/create.rb
index 07dd1b322..9c58dc71a 100644
--- a/Library/Homebrew/dev-cmd/create.rb
+++ b/Library/Homebrew/dev-cmd/create.rb
@@ -3,8 +3,7 @@
#: Homebrew will attempt to automatically derive the formula name
#: and version, but if it fails, you'll have to make your own template. The `wget`
#: formula serves as a simple example. For the complete API have a look at
-#:
-#: <http://www.rubydoc.info/github/Homebrew/brew/master/Formula>
+#: <http://www.rubydoc.info/github/Homebrew/brew/master/Formula>.
#:
#: If `--autotools` is passed, create a basic template for an Autotools-style build.
#: If `--cmake` is passed, create a basic template for a CMake-style build.
@@ -142,12 +141,10 @@ class FormulaCreator
def generate!
raise "#{path} already exists" if path.exist?
- if version.nil?
+ if version.nil? || version.null?
opoo "Version cannot be determined from URL."
puts "You'll need to add an explicit 'version' to the formula."
- end
-
- if fetch? && version
+ elsif fetch?
r = Resource.new
r.url(url)
r.version(version)