mirror of
https://github.com/Hilbis/Hilbish
synced 2025-06-30 16:22:03 +00:00
18 lines
246 B
Lua
18 lines
246 B
Lua
local fs = require 'fs'
|
|
local M = {}
|
|
|
|
function M.pipe(cmd, cmd2)
|
|
local pr, pw = fs.pipe()
|
|
hilbish.run(cmd, {
|
|
out = pw,
|
|
err = pw,
|
|
})
|
|
pw:close()
|
|
hilbish.run(cmd2, {
|
|
input = pr
|
|
})
|
|
return {command = cmd2, input = pr, out }
|
|
end
|
|
|
|
return M
|