From 1d5c31719aedb0425d590de6ca0900cf2b09c9c7 Mon Sep 17 00:00:00 2001 From: Leonardo Mosquera Date: Mon, 13 Feb 2023 20:19:47 -0300 Subject: [PATCH] Correct parameter naming for PTY.spawn (#678) Per the docs, first parameter for the block is STDOUT + STDERR, 2nd one is STDIN: https://ruby-doc.org/3.1.3/exts/pty/PTY.html#method-c-spawn As it is now, the method looks like it's reading from STDIN, though in fact it's reading from an incorrectly named parameter for STDOUT. --- image/auto_build.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/image/auto_build.rb b/image/auto_build.rb index d2f830c..b507ec6 100644 --- a/image/auto_build.rb +++ b/image/auto_build.rb @@ -12,9 +12,9 @@ images = { def run(command) lines = [] - PTY.spawn(command) do |stdin, stdout, pid| + PTY.spawn(command) do |stdout, stdin, pid| begin - stdin.each do |line| + stdout.each do |line| lines << line puts line end -- 2.25.1