From 66388b7a437165507bbf3cc42d47482ceb7e0bc3 Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Tue, 31 Jan 2012 17:57:20 -0600 Subject: [PATCH] create: punt on bad URLs When we can't detect a name from the URL, just ask the user. Signed-off-by: Jack Nagel --- Library/Homebrew/cmd/create.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Library/Homebrew/cmd/create.rb b/Library/Homebrew/cmd/create.rb index 3721d5986e..4ea06a610c 100644 --- a/Library/Homebrew/cmd/create.rb +++ b/Library/Homebrew/cmd/create.rb @@ -20,7 +20,7 @@ module Homebrew extend self :autotools end - if fc.name.to_s.strip.empty? + if fc.name.nil? or fc.name.to_s.strip.empty? path = Pathname.new url print "Formula name [#{path.stem}]: " fc.name = __gets || path.stem @@ -67,7 +67,7 @@ class FormulaCreator path = Pathname.new url /(.*?)[-_.]?#{path.version}/.match path.basename @name = $1 - @path = Formula.path $1 + @path = Formula.path $1 unless $1.nil? end def version