Sha256: 5628494d3042d9efdda83ae19205dcba4d56fb8fba17a95216c87ae7084c22ec
Contents?: true
Size: 855 Bytes
Versions: 19
Compression:
Stored size: 855 Bytes
Contents
# typed: true # frozen_string_literal: true module Packwerk module Generators class RootPackage extend T::Sig class << self def generate(root:, out:) new(root: root, out: out).generate end end def initialize(root:, out: $stdout) @root = root @out = out end sig { returns(T::Boolean) } def generate if Dir.glob("#{@root}/package.yml").any? @out.puts("⚠️ Root package already exists.") return true end @out.puts("📦 Generating `package.yml` file for root package...") source_file_path = File.join(__dir__, "/templates/package.yml") FileUtils.cp(source_file_path, @root) @out.puts("✅ `package.yml` for the root package generated in #{@root}") true end end end end
Version data entries
19 entries across 19 versions & 1 rubygems