Class: Lutaml::Xsd::Commands::PackageCommand::AutoBuildCommand

Inherits:
BaseCommand
  • Object
show all
Defined in:
lib/lutaml/xsd/commands/package_command.rb

Overview

Auto-build command implementation

Instance Attribute Summary

Attributes inherited from BaseCommand

#options

Instance Method Summary collapse

Constructor Details

#initialize(config_file, options) ⇒ AutoBuildCommand

Returns a new instance of AutoBuildCommand.



775
776
777
778
# File 'lib/lutaml/xsd/commands/package_command.rb', line 775

def initialize(config_file, options)
  super(options)
  @config_file = config_file
end

Instance Method Details

#runObject



780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
# File 'lib/lutaml/xsd/commands/package_command.rb', line 780

def run
  validate_config_file

  package_path = determine_package_path

  if should_rebuild?(package_path)
    verbose_output "Cache is stale or --force specified, rebuilding..."
    build_package
  else
    output "✓ Package is up-to-date: #{package_path}"
    output "  Use --force to rebuild anyway"
  end
rescue StandardError => e
  error "Auto-build failed: #{e.message}"
  verbose_output e.backtrace.join("\n") if verbose?
  exit 1
end