openresty/lua-resty-shell

It's blocking apt-get update

Opened this issue · 1 comments

Hi, I have following code and was expecting line by line printing to screens instead of print all output

local shell = require "resty.shell"

local stdin = "hello"
local timeout = 1000  -- ms
local max_size = 4096  -- byte

local ok, stdout, stderr, reason, status =
    shell.run([[apt-get update]], stdin, timeout, max_size)
    
    ngx.say(ok)
    ngx.say("stdout " ..stdout)
    ngx.say("stderr " ..stderr)
    ngx.say("reason " ..reason)
    ngx.say(status)
    
    ngx.say("Good !!")
if not ok then
   ngx.say("errror")
end