Class: AptControl::CLI::Promote

Inherits:
Object
  • Object
show all
Includes:
Common
Defined in:
lib/apt_control/cli/promote.rb

Instance Method Summary collapse

Methods included from Common

#apt_site, #build_archive, #control_file, #each_package_state, #fs_listener_factory, #jabber, #jabber_enabled?, #logger, #new_include_cmd, #notify, #package_states, #validate_config!

Instance Method Details

#runObject



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/apt_control/cli/promote.rb', line 11

def run
  validate_config!

  begin
    promote_cmd = AptControl::Commands::Promote.new(
      control_file: control_file,
      package_states: package_states)

    begin
      promote_cmd.run(arguments[:src_distribution],
        arguments[:dest_distribution],
        arguments[:package])
    rescue ArgumentError => e
      raise Climate::ExitException, e.message
    end
  end
end