Sha256: 1a0e50cff8f6353df663c8258f92cc0afca746a8356bc9adb11349ca240c2f17

Contents?: true

Size: 1.3 KB

Versions: 1

Compression:

Stored size: 1.3 KB

Contents

require "middleman-core/templates"

module Middleman
  module WizardTemplate

    class Template < Middleman::Templates::Base
      def self.source_root
        File.join(File.dirname(__FILE__), 'template')
      end
  
      def build_scaffold
        template "config.tt", File.join(location, "config.rb")
        template "README.tt", File.join(location, "README.md")
        directory "source", File.join(location, "source")
        directory "closure", File.join(location, "closure")

        empty_directory File.join(location, "source", "images")
    
        # empty_directory File.join(location, "source", options[:css_dir])
        # empty_directory File.join(location, "source", options[:js_dir])
        # empty_directory File.join(location, "source", options[:images_dir])
      end

      class_option :'skip-bower', :type => :boolean, :default => false

      # Write a Bundler Gemfile file for project
      # @return [void]
      def generate_bower!
        return if options[:'skip-bower']
        template "bowerrc.tt", File.join(location, ".bowerrc")
        template "bowerjson.tt", File.join(location, "bower.json")

        inside(location) do
          run('npm install')
        end unless ENV["TEST"]
      end
    end
  end
end

Middleman::Templates.register(:wizard, Middleman::WizardTemplate::Template)

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
middleman-wizard-template-1.0.4 lib/middleman-wizard-template/template.rb