Validate the template option for "middleman init"

This commit is contained in:
Ben Hollis 2011-12-13 23:58:34 -08:00
parent 0b90a6a800
commit e1b338041b

View file

@ -41,7 +41,7 @@ module Middleman
def init(name) def init(name)
key = options[:template].to_sym key = options[:template].to_sym
unless Middleman::Templates.registered.has_key?(key) unless Middleman::Templates.registered.has_key?(key)
key = :default raise Thor::Error.new "Unknown project template '#{key}'"
end end
thor_group = Middleman::Templates.registered[key] thor_group = Middleman::Templates.registered[key]
@ -120,4 +120,4 @@ module Middleman
exit 0 exit 0
end end
end end
end end