Method: Mixin::Shell#execute

Defined in:
lib/fox/interface/thor/mixin/shell.rb

#execute(command) ⇒ String

Returns result of command

Parameters:

  • command (String)

    Shell command string with arguments

Returns:

  • (String)

    Returns result of command

Raises:

  • (ArgumentError)


70
71
72
73
74
75
76
77
# File 'lib/fox/interface/thor/mixin/shell.rb', line 70

def execute command

  exists  = which( command )
  raise ArgumentError, "Command not found" unless( exists )
  result  = `#{command}`

  return result
end