Sha256: e145c530a9314e660747f763e191f2840e005cd600f1818bddd1de9abcd7aab0
Contents?: true
Size: 518 Bytes
Versions: 50
Compression:
Stored size: 518 Bytes
Contents
require 'pty' module CommandRunner def self.run_command_and_print(cmd, output) output.puts "[1mExecuting #{cmd}[0m\n\n" PTY.spawn(cmd) do |read_stream, write_stream, pid| begin while chars = read_stream.read(1) output.print chars end rescue Errno::EIO end Process.wait(pid) end output.puts "\n\n\n" if $? exit 1 if $?.exitstatus > 0 else raise "Huh?! We didn't get an exit status from that last one: #{cmd}" end end end
Version data entries
50 entries across 50 versions & 1 rubygems