diff options
Diffstat (limited to 'Library/Homebrew/dev-cmd/create.rb')
| -rw-r--r-- | Library/Homebrew/dev-cmd/create.rb | 9 |
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) |
