lib/octopolo/cli.rb in octopolo-0.3.3 vs lib/octopolo/cli.rb in octopolo-0.3.4
- old
+ new
@@ -24,21 +24,19 @@
# display the command
say command if say_command
# and then perform it
if Open3.respond_to?(:capture3)
output, error, status = Open3.capture3(command)
- raise "exit_status=#{status.exitstatus}; stderr=#{error}" unless status.success?
+ raise "command=#{command}; exit_status=#{status.exitstatus}; stderr=#{error}" unless status.success?
else
# Only necessary as long as we use 1.8.7, which doesn't have Open3.capture3
output = `#{command}`
end
# speak the output
say output if say_command
# return the output of the command
output
- rescue => e
- say "Unable to perform '#{command}': #{e.message}"
end
# Public: Perform the command, but do not print out the command
#
# command - A String containing the command to perform.