mirror of
https://github.com/middleman/middleman.git
synced 2022-11-09 12:20:27 -05:00
27 lines
1 KiB
Ruby
Executable file
27 lines
1 KiB
Ruby
Executable file
#!/usr/bin/env ruby
|
|
require File.join(File.dirname(File.dirname(__FILE__)), 'lib', 'middleman')
|
|
require "middleman/templates"
|
|
|
|
module Middleman
|
|
class Generator < ::Thor::Group
|
|
include Thor::Actions
|
|
|
|
argument :location, :type => :string, :desc => "New project location"
|
|
|
|
available_templates = Middleman::Templates.registered_names.join(", ")
|
|
class_option :template, :aliases => "-T", :default => "default", :desc => "Optionally use a pre-defined project template: #{available_templates}"
|
|
|
|
class_option :css_dir, :default => "stylesheets", :desc => 'The path to the css files'
|
|
class_option :js_dir, :default => "javascripts", :desc => 'The path to the javascript files'
|
|
class_option :images_dir, :default => "images", :desc => 'The path to the image files'
|
|
|
|
def create_project
|
|
key = options[:template].to_sym
|
|
key = :default unless Middleman::Templates.registered_templates.has_key?(key)
|
|
|
|
Middleman::Templates.registered_templates[key].start
|
|
end
|
|
end
|
|
end
|
|
|
|
Middleman::Generator.start
|