class Bookwatch::Commands::Components::Bind::LayoutPreparer

Attributes

fs[R]

Public Class Methods

new(fs) click to toggle source
# File lib/bookwatch/commands/components/bind/layout_preparer.rb, line 6
def initialize(fs)
  @fs = fs
end

Public Instance Methods

prepare(output_locations, cloner, ref_override, config) click to toggle source
# File lib/bookwatch/commands/components/bind/layout_preparer.rb, line 12
def prepare(output_locations, cloner, ref_override, config)
  if config.has_option?('layout_repo')

    cloned_repo = cloner.call(source_repo_name: config.layout_repo,
                              source_ref: ref_override || config.layout_repo_ref,
                              destination_parent_dir: Dir.mktmpdir)

    fs.copy_contents(cloned_repo.path, output_locations.site_generator_home)
  end
  fs.copy_contents(File.absolute_path('master_middleman'), output_locations.site_generator_home)
end