brew-create: don't break when given --set-version

Since 9f2782812cbaf2, specifying a version breaks with:

    Error: undefined method `detected_from_url?' for "1.2.2":String

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
This commit is contained in:
Ches Martin 2013-08-02 04:44:14 +07:00 committed by Adam Vandenberg
parent ba96851606
commit 7d30e4445e

View File

@ -84,7 +84,9 @@ class FormulaCreator
else
@path = Formula.path name
end
if @version.nil?
if @version
@version = Version.new(@version)
else
@version = Pathname.new(url).version
end
end