class Bcome::Registry::Command::Shortcut

Public Instance Methods

command() click to toggle source
# File lib/objects/registry/command/shortcut.rb, line 24
def command
  @data[:shortcut_command]
end
execute(node, _arguments) click to toggle source

In which the bcome context is a shortcut to a more complex command

# File lib/objects/registry/command/shortcut.rb, line 7
def execute(node, _arguments) ## We'll add in arguments later
  begin
    if run_as_pseudo_tty?
      node.pseudo_tty command
    else
      puts "\n(#{node.namespace})$".terminal_prompt + ">\s#{command}"
      ::Bcome::Orchestrator.instance.tail_all_command_output!(node)
      node.run command
      ::Bcome::Orchestrator.instance.reset!
    end
  rescue Interrupt
    ::Bcome::Orchestrator.instance.reset!
    puts "\nExiting gracefully from interrupt\n".warning
  end
  nil
end
run_as_pseudo_tty?() click to toggle source
# File lib/objects/registry/command/shortcut.rb, line 28
def run_as_pseudo_tty?
  @data[:run_as_pseudo_tty]
end