Sha256: 0c1411159d3923db22c93162dcbedde6ff35fd764705b092065d8b9b2b79bbe4
Contents?: true
Size: 901 Bytes
Versions: 2
Compression:
Stored size: 901 Bytes
Contents
# frozen_string_literal: true # Released under the MIT License. # Copyright, 2020-2022, by Samuel Williams. require_relative 'modernize/license' require_relative 'modernize/version' require 'build/files/glob' require 'fileutils' module Bake module Modernize ROOT = File.expand_path("../..", __dir__) TEMPLATE_ROOT = Build::Files::Path.new(ROOT) + "template" def self.template_path_for(path) TEMPLATE_ROOT + path end def self.copy_template(source_path, destination_path) glob = Build::Files::Glob.new(source_path, '**/*') glob.each do |path| full_path = File.join(destination_path, path.relative_path) if File.directory?(path) unless File.directory?(full_path) FileUtils.mkdir_p(full_path) end else unless FileUtils.identical?(path, full_path) FileUtils::Verbose.cp(path, full_path) end end end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
bake-modernize-0.17.1 | lib/bake/modernize.rb |
bake-modernize-0.17.0 | lib/bake/modernize.rb |