mirror of
https://github.com/middleman/middleman.git
synced 2022-11-09 12:20:27 -05:00
34 lines
No EOL
836 B
Ruby
Executable file
34 lines
No EOL
836 B
Ruby
Executable file
#!/usr/bin/env ruby
|
|
require 'templater'
|
|
|
|
module Generators
|
|
extend Templater::Manifold
|
|
desc "Generator for streamlining staticmatic"
|
|
|
|
class NewSite < Templater::Generator
|
|
desc "Creates a new staticmatic scaffold."
|
|
first_argument :location, :required => true, :desc => "Project location"
|
|
|
|
# css_dir
|
|
# images_dir
|
|
|
|
def destination_root
|
|
File.expand_path(location)
|
|
end
|
|
|
|
def self.source_root
|
|
File.join(File.dirname(__FILE__), '..', 'lib', 'middleman', 'template')
|
|
end
|
|
|
|
file :init, "init.rb"
|
|
glob! :views
|
|
glob! :public
|
|
empty_directory :stylesheets, "public/stylesheets"
|
|
empty_directory :javascripts, "public/javascripts"
|
|
empty_directory :images, "public/images"
|
|
end
|
|
|
|
add :setup, NewSite
|
|
end
|
|
|
|
Generators.run_cli(Dir.pwd, 'mm-init', 1, %w(setup).concat(ARGV)) |