aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorXu Cheng2016-07-18 00:03:56 +0800
committerXu Cheng2016-07-18 00:03:56 +0800
commitb6772c1fde5878fdb492aad8b4f9c0bc10284a29 (patch)
treed12b7d6e7cd83bfd5c788c270d3c36df225d4975 /Library
parent092d4712a1d00bc08eb0515d8e61f7859c7a2de0 (diff)
downloadbrew-b6772c1fde5878fdb492aad8b4f9c0bc10284a29.tar.bz2
create: path.version may be nil
Fixes https://github.com/Homebrew/homebrew-core/issues/3067.
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/cmd/create.rb3
1 files changed, 1 insertions, 2 deletions
diff --git a/Library/Homebrew/cmd/create.rb b/Library/Homebrew/cmd/create.rb
index ac936818a..ed71a6d39 100644
--- a/Library/Homebrew/cmd/create.rb
+++ b/Library/Homebrew/cmd/create.rb
@@ -110,8 +110,7 @@ class FormulaCreator
when %r{github\.com/\S+/(\S+)/archive/}
@name = $1
else
- /(.*?)[-_.]?#{Regexp.escape(path.version)}/.match path.basename
- @name = $1
+ @name = path.basename.to_s[/(.*?)[-_.]?#{Regexp.escape(path.version.to_s)}/, 1]
end
end
update_path