Method: Sym::App::KeyChain#execute

Defined in:
lib/sym/app/keychain.rb

#execute(command) ⇒ Object



57
58
59
60
61
62
63
64
65
66
# File 'lib/sym/app/keychain.rb', line 57

def execute(command)
  command += ' 2>/dev/null' if stderr_disabled
  puts "> #{command.yellow.green}" if opts[:verbose]
  output = `#{command}`
  result = $?
  raise Sym::Errors::KeyChainCommandError.new("Command error: #{result}, command: #{command}") unless result.success?
  output.chomp
rescue Errno::ENOENT => e
  raise Sym::Errors::KeyChainCommandError.new("Command error: #{e.message}, command: #{command}")
end