Sha256: 4361a27cb2e2c8cc9885845893efb53a6f9641efe3a1131c4819e14baf1c2406

Contents?: true

Size: 1.12 KB

Versions: 4

Compression:

Stored size: 1.12 KB

Contents

# typed: strict
# frozen_string_literal: true

module Packwerk
  module Commands
    class InitCommand < BaseCommand
      extend T::Sig

      description "set up packwerk"

      sig { override.returns(T::Boolean) }
      def run
        out.puts("📦 Initializing Packwerk...")

        configuration_file = Generators::ConfigurationFile.generate(
          root: configuration.root_path,
          out: out
        )

        root_package = Generators::RootPackage.generate(root: configuration.root_path, out: out)

        success = configuration_file && root_package

        if success
          out.puts(<<~EOS)

            🎉 Packwerk is ready to be used. You can start defining packages and run `bin/packwerk check`.
            For more information on how to use Packwerk, see: https://github.com/Shopify/packwerk/blob/main/USAGE.md
          EOS
        else
          out.puts(<<~EOS)

            ⚠️  Packwerk is not ready to be used.
            Please check output and refer to https://github.com/Shopify/packwerk/blob/main/USAGE.md for more information.
          EOS
        end

        success
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
packwerk-3.2.2 lib/packwerk/commands/init_command.rb
packwerk-3.2.1 lib/packwerk/commands/init_command.rb
packwerk-3.2.0 lib/packwerk/commands/init_command.rb
packwerk-3.1.0 lib/packwerk/commands/init_command.rb