#!/usr/bin/env ruby
# frozen_string_literal: true

unless defined?(Spring)
  require "packwerk/disable_sorbet"
end

require "packwerk"

# Needs to be run in test environment in order to have test helper paths available in the autoload paths
ENV["RAILS_ENV"] = "test"

# Command line arguments needs to be duplicated because spring modifies it
packwerk_argv = ARGV.dup
cli = Packwerk::Cli.new(style: Packwerk::OutputStyles::Coloured.new)
cli.run(packwerk_argv)
