Created
September 21, 2016 11:10
-
-
Save anonymous/da78b0e3906e339de02e4fe44823ba19 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
vagrant@veds:/eds/data$ ./start.sh
'Bundler: installing plugins if necessary
command: bundler install
./start.sh:17:in
run_command': undefined local variable or method
wait_thr' for main:Object (NameError)from ./start.sh:25:in `