Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

Created September 21, 2016 11:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/da78b0e3906e339de02e4fe44823ba19 to your computer and use it in GitHub Desktop.
Save anonymous/da78b0e3906e339de02e4fe44823ba19 to your computer and use it in GitHub Desktop.
def run_command(info, command, prefix)
puts info.blue
puts "command: #{command}".green
binary = command.split(" ")[0]
output = ""
Open3.popen3(command) do |stdin, stdout, stderr, wait_thr|
while line = stderr.gets
puts "#{binary} ====> #{line}"
output += line
end
end
exit_status = wait_thr.value
unless exit_status.success?
abort "command \"#{command}\" failed".red
end
return output
end
@stephaneerard
Copy link

vagrant@veds:/eds/data$ ./start.sh
Bundler: installing plugins if necessary
command: bundler install
./start.sh:17:in run_command': undefined local variable or methodwait_thr' for main:Object (NameError)
from ./start.sh:25:in `

'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment