From b08c070481756919091dfe12a4a1876cf8c87644 Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Thu, 17 Jul 2014 19:40:44 -0500 Subject: [PATCH] Only ask for the stem once --- Library/Homebrew/cmd/create.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Library/Homebrew/cmd/create.rb b/Library/Homebrew/cmd/create.rb index 2ea098e0ca..dcef372d87 100644 --- a/Library/Homebrew/cmd/create.rb +++ b/Library/Homebrew/cmd/create.rb @@ -36,11 +36,11 @@ module Homebrew :autotools end - 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 - fc.path = Formula.path fc.name + if fc.name.nil? || fc.name.strip.empty? + stem = Pathname.new(url).stem + print "Formula name [#{stem}]: " + fc.name = __gets || stem + fc.path = Formula.path(fc.name) end # Don't allow blacklisted formula, or names that shadow aliases,