class Aerosol::SshCommand

Public Instance Methods

execute() click to toggle source
Calls superclass method Aerosol::AbstractCommand#execute
# File lib/aerosol/cli.rb, line 35
def execute
  super
  if deploy = Aerosol.deploy(deploy_name.to_sym)
    ssh_commands = deploy.generate_ssh_commands
    raise 'No instances to ssh too!' if ssh_commands.empty?

    ssh_commands.each do |ssh_command|
      puts ssh_command
    end

    if run_first?
      system(ssh_commands.first)
    end
  end
end