aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorJack Nagel2012-01-31 17:57:20 -0600
committerJack Nagel2012-01-31 17:57:20 -0600
commitdde7901b94d93bdbbc86355d508f1ecd3e7116ef (patch)
treee0e82aaeb76c1357bc720ace170843b1ec4d0176 /Library
parentcf9f65d5a0155fe860f40317ba07f13d3fdd3ac7 (diff)
downloadhomebrew-dde7901b94d93bdbbc86355d508f1ecd3e7116ef.tar.bz2
create: punt on bad URLs
When we can't detect a name from the URL, just ask the user. Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/cmd/create.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/Library/Homebrew/cmd/create.rb b/Library/Homebrew/cmd/create.rb
index 3721d5986..4ea06a610 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