Change stdout to the correct option of tar

This commit is contained in:
DirkFi 2024-09-03 11:14:57 -07:00 committed by sxyazi
parent 89f83efb90
commit 3f17bbdc60
No known key found for this signature in database

View file

@ -54,7 +54,7 @@ function M:seek(units)
end end
function M:spawn_tar(args) function M:spawn_tar(args)
local stdout = args[1] == "l" and Command.PIPED or Command.NULL local stdout = args[1] and args[1]:sub(0, 2) == "-t" and Command.PIPED or Command.NULL
local child, code = Command("tar"):args(args):stdout(stdout):stderr(Command.PIPED):spawn() local child, code = Command("tar"):args(args):stdout(stdout):stderr(Command.PIPED):spawn()
if not child then if not child then
return nil, "Failed to spawn, error code: " .. tostring(code) return nil, "Failed to spawn, error code: " .. tostring(code)