enable downlevelIteration build option in typescript

This commit is contained in:
lxsang
2021-05-11 15:05:28 +02:00
parent 2fc1a8cee4
commit 1d55e82259
20 changed files with 594 additions and 16 deletions

View File

@ -0,0 +1,31 @@
local args=...
local result = function(data)
return { error = false, result = data }
end
local error = function(msg)
return {error = msg, result = false}
end
local handle = {}
handle.exec = function(data)
local cmd = data.cmd
if data.pwd then
cmd = "cd "..require("vfs").ospath(data.pwd).. " && "..cmd
end
cmd = cmd.." 2>&1"
local pipe = io.popen(cmd)
for line in pipe:lines() do
echo(JSON.encode(result(line)))
end
pipe:close()
return result("Done: ["..cmd.."]")
end
if args.action and handle[args.action] then
return handle[args.action](args.args)
else
return error("Invalid action parameter")
end